Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230

 

 

 

Unable to start redshift on startup (or login)

Graphical Environments, Managers, Multimedia & Desktop questions.
Post Reply
Message
Author
Morales1235
Posts: 20
Joined: 2018-07-18 18:59

Unable to start redshift on startup (or login)

#1 Post by Morales1235 »

I use Debian 9 with gdm3. Redshift is installed via apt-get install.
There are ways I tried to execute redshift automatically on login/startup:


Following every way I found in the web redshift doesn't start after login. I use debian 9 with GNOME shell.
Redshift from official Debian repository, installed via apt-get
Way 1

Add file: ~/.config/autostart/redshift.desktop with permission (chmod +x 'file')

Code: Select all

#[Desktop Entry]
Version=1.0
Type=Application
Terminal=false
Exec='/home/mateusz/run_redshift.sh'
Name=redshift_script
inside run_redshift.sh:

Code: Select all

/usr/bin/redshift -l 52.3:16.3 -t 6700:3500
Running that script from terminal has expected effect. BTW, as you see first line of .desktop file commented, because it gives an error (after running .desktop file):
: line 1: [Desktop: command not found
Script seems to run, I can see echo commands inside, but redshift doesn't throw any error

Way 2

at the end of file: /etc/gdm3/Init/Default before 'exit 0' added those lines:

Code: Select all

/usr/bin/redshift -l 52.3:16.3 -t 6700:3500
Way 3

Code: Select all

sudo crontab -e 

at the end of the file added:

Code: Select all

@reboot export DISPLAY=:0 && /usr/bin/redshift -l 52.3:16.3 -t 6700:3500
Way 4

I also found solution to add command to file: /etc/rc.local
but there has not been that file. I added this with my command

Code: Select all

pcscd
/usr/bin/redshift -l 52.3:16.3 -t 6700:3500
exit 0
Nothing of this works. For now, can they interrupt each other (all the solutions are applied currently)?

cronoik
Posts: 310
Joined: 2015-05-20 21:17

Re: Unable to start redshift on startup (or login)

#2 Post by cronoik »

Have you tried gnome-session-properties ?

https://linux.die.net/man/1/gnome-session-properties
Have a nice day!

User avatar
bw123
Posts: 4015
Joined: 2011-05-09 06:02
Has thanked: 1 time
Been thanked: 28 times

Re: Unable to start redshift on startup (or login)

#3 Post by bw123 »

the pkg includes a service file, and a .desktop so I'd use those.

https://packages.debian.org/stretch/amd ... t/filelist
resigned by AI ChatGPT

Morales1235
Posts: 20
Joined: 2018-07-18 18:59

Re: Unable to start redshift on startup (or login)

#4 Post by Morales1235 »

I couldn't find redshift there... but I have installed it via apt-get.
GUI package manager show me it is not isntalled... I have installed it this way and its working! No sure which way te OS choose to run redshift on startup but it works...
Theme to close.

User avatar
debiman
Posts: 3063
Joined: 2013-03-12 07:18

Re: Unable to start redshift on startup (or login)

#5 Post by debiman »

Morales1235 wrote:

Code: Select all

#[Desktop Entry]
Version=1.0
Type=Application
Terminal=false
Exec='/home/mateusz/run_redshift.sh'
Name=redshift_script
inside run_redshift.sh:

Code: Select all

/usr/bin/redshift -l 52.3:16.3 -t 6700:3500
Running that script from terminal has expected effect. BTW, as you see first line of .desktop file commented, because it gives an error (after running .desktop file):
: line 1: [Desktop: command not found
WRONG - a .desktop file is not an executable script. you don't "run" it.
Way 2
at the end of file: /etc/gdm3/Init/Default before 'exit 0' added those lines:

Code: Select all

/usr/bin/redshift -l 52.3:16.3 -t 6700:3500
this sounds horrible and best case scenario i can see here is that gdm simply ignores it.

Way 3
Way 4
again, overly complicated and error prone. no, and no.

i still think Way 1 was the best solution.

i'm pretty sure you do NOT need the 'single quotes' around the Exec command. remove them.

if that doesn't help, please open a terminal, and enter

Code: Select all

/home/mateusz/run_redshift.sh
then show us the complete output, including the command itself.
use code tags for code.

PS:
also show us this:

Code: Select all

cat /usr/lib/systemd/user/redshift.service /usr/share/applications/redshift.desktop
PPS:
i heard rumours that redshift doesn't work under gnome; maybe this is relevant: https://github.com/benzea/gnome-shell-e ... n-redshift

arzgi
Posts: 1185
Joined: 2008-02-21 17:03
Location: Finland
Been thanked: 31 times

Re: Unable to start redshift on startup (or login)

#6 Post by arzgi »

debiman wrote: PPS:
i heard rumours that redshift doesn't work under gnome; maybe this is relevant: https://github.com/benzea/gnome-shell-e ... n-redshift

Code: Select all

aptitude search redshift
p   gnome-shell-extension-redshift  - redshift extension for GNOME Shell        
p   gtk-redshift                    - transitional dummy package                
p   plasma-applet-redshift-control  - Adjusts the color temperature of your scre
p   redshift                        - Adjusts the color temperature of your scre
p   redshift-gtk                    - Adjusts the color temperature of your scre

User avatar
debiman
Posts: 3063
Joined: 2013-03-12 07:18

Re: Unable to start redshift on startup (or login)

#7 Post by debiman »

^ i guess you're trying to say something, but i don't know what.

arzgi
Posts: 1185
Joined: 2008-02-21 17:03
Location: Finland
Been thanked: 31 times

Re: Unable to start redshift on startup (or login)

#8 Post by arzgi »

debiman wrote:^ i guess you're trying to say something, but i don't know what.
First, why suggest github, if the same package (gnome-shell-extension-redshift) is available in stable Debian repo.
It's older than github version, but so is gnome if using stable.

If that package is in stable Debian, why would it not work?

I don't use gnome or redshift.

User avatar
debiman
Posts: 3063
Joined: 2013-03-12 07:18

Re: Unable to start redshift on startup (or login)

#9 Post by debiman »

arzgi wrote:First, why suggest github, if the same package (gnome-shell-extension-redshift) is available in stable Debian repo.
ah, i see.
i wasn't "suggesting" (installing from) github, but there was something written there that was (vaguely) relevant to this thread.
apparently you reacted without clicking the link?

slayde
Posts: 4
Joined: 2018-01-10 02:11

Re: Unable to start redshift on startup (or login)

#10 Post by slayde »

I installed redshift-gtk, and that shows up on Gnome and Cinnamon menus and puts an icon in the notification area from which you can change its settings. It apparently picked up my locale from the system automatically and it's working fine.

User avatar
debiman
Posts: 3063
Joined: 2013-03-12 07:18

Re: Unable to start redshift on startup (or login)

#11 Post by debiman »

i noticed that redshift's (and other similar programs') geolocation based functionality has a flaw:
for example, i live so far north that, in the summer, redshift wouldn't kick in until it's way past bed time.
in the end, i need a static solution: regardless of sunrise/sunset, when i go to work the following morning, i lower the blinds at a certain time and it's time to go to bed. redshift should kick in before that. the same for the weekends, if i want to avoid an all-nighter in front of the screen.

all this is more dependent on social & cultural things than on actual sunrise and sunset.

and so the geoip dependencies are useless - system time is enough.

Morales1235
Posts: 20
Joined: 2018-07-18 18:59

Re: Unable to start redshift on startup (or login)

#12 Post by Morales1235 »

debiman wrote: if that doesn't help, please open a terminal, and enter

Code: Select all

/home/mateusz/run_redshift.sh
then show us the complete output, including the command itself.
use code tags for code.
Sometimes redsihft shows error on startup, something about 'Unable to use geoclude...'. Then I use above command to run, and it works

Code: Select all

Trying location provider `geoclue2'...
Using provider `geoclue2'.
Using method `randr'.
using geoclude even though it has my coords?
debiman wrote: PS:
also show us this:

Code: Select all

cat /usr/lib/systemd/user/redshift.service /usr/share/applications/redshift.desktop
If you still would like to see:

Code: Select all

[Unit]
Description=Redshift display colour temperature adjustment
Documentation=http://jonls.dk/redshift/
After=display-manager.service

[Service]
ExecStart=/usr/bin/redshift
Restart=always

[Install]
WantedBy=default.target
[Desktop Entry]
Version=1.0
Name=Redshift
Name[de]=Redshift
Name[es]=Redshift
Name[fr]=Redshift
Name[hu]=Redshift
Name[it]=Redshift
Name[lt]=Redshift
Name[pl]=Redshift
Name[pt_BR]=Redshift
Name[ru]=Redshift
Name[tr]=Redshift
Name[zh_CN]=红移
GenericName=Color temperature adjustment
GenericName[cs]=Přizpůsobení barevné teploty
GenericName[da]=Justering af farvetemperatur
GenericName[de]=Farbtemperatur Anpassung
GenericName[es]=Ajuste de la temperatura de color
GenericName[fr]=Réglage de la température de couleur
GenericName[hu]=Szín hőmérséklet beállítás
GenericName[it]=Regolazione della temperatura del colore
GenericName[lt]=Spalvos temperatūros reguliavimas
GenericName[nl]=Kleurtemperatuur aanpassing
GenericName[pl]=Dostosowanie temperatury barwowej
GenericName[ru]=Настройка цветовой температуры
GenericName[tr]=Renk sıcaklığı ayarı
GenericName[zh_CN]=色温调节
Comment=Color temperature adjustment tool
Comment[cs]=Nástroj pro přizpůsobení barevné teploty
Comment[da]=Justeringsværktøj for farvetemperatur
Comment[de]=Farbtemperatur Anpassungswerkzeug
Comment[es]=Herramienta para el ajuste de la temperatura de color
Comment[fr]=Outil de réglage de la température de couleur
Comment[hu]=Színhőmérséklet beállító eszköz
Comment[it]=Strumento per la regolazione della temperatura del colore
Comment[lt]=Spalvos temperatūros reguliavimo įrankis
Comment[nl]=Kleurtemperatuur aanpassingsprogramma
Comment[pl]=Narzędzie do dostosowywania temperatury barwowej
Comment[ru]=Инструмент регулирования цветовой температуры
Comment[tr]=Renk sıcaklığı ayarlama aracı
Comment[zh_CN]=色温调节工具
Exec=redshift
Icon=redshift
Terminal=true
Type=Application
Categories=Utility;
NoDisplay=true

User avatar
Danielsan
Posts: 659
Joined: 2010-10-10 22:36
Has thanked: 5 times

Re: Unable to start redshift on startup (or login)

#13 Post by Danielsan »

I resolved in this way:

1) I modified the file /etc/geoclue/geoclue.conf adding this section:

Code: Select all

[redshift]
allowed=true
system=false
users=
2) I installed the file geoclue-2-demo

3) I put or I created a file geoclue-demo-agent.desktop in ~/.config/autostart/

Code: Select all

[Desktop Entry]
Name=Geoclue Demo agent
GenericName=Demo geoclue agent
Keywords=geolocation;
Exec=/usr/lib/geoclue-2.0/demos/agent
Icon=mark-location-symbolic
NotShowIn=GNOME;
NoDisplay=true
Terminal=false
Type=Application
And it started working again.

User avatar
debiman
Posts: 3063
Joined: 2013-03-12 07:18

Re: Unable to start redshift on startup (or login)

#14 Post by debiman »

^ Morales, did this help?

if not...
Morales1235 wrote:
debiman wrote: if that doesn't help, please open a terminal, and enter

Code: Select all

/home/mateusz/run_redshift.sh
then show us the complete output, including the command itself.
use code tags for code.
Sometimes redsihft shows error on startup, something about 'Unable to use geoclude...'. Then I use above command to run, and it works

Code: Select all

Trying location provider `geoclue2'...
Using provider `geoclue2'.
Using method `randr'.
using geoclude even though it has my coords?
i just realised you never showed us the "run_redshift.sh" script...?

Morales1235
Posts: 20
Joined: 2018-07-18 18:59

Re: Unable to start redshift on startup (or login)

#15 Post by Morales1235 »

debiman wrote: i just realised you never showed us the "run_redshift.sh" script...?
I did, in the first post. But as I said few posts ago redshift works fine, but sometimes fails on the startup; I wrote prev post just to answer question, I am not sure to try next advice until it is not very serious problem.

Post Reply