Unable to start redshift on startup (or login)

Everything about X, Gnome, KDE, ... and everything running on it

Unable to start redshift on startup (or login)

Postby Morales1235 » 2018-08-05 09:42

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)?
Morales1235
 
Posts: 14
Joined: 2018-07-18 18:59

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

Postby cronoik » 2018-08-05 10:16

Have you tried gnome-session-properties ?

https://linux.die.net/man/1/gnome-session-properties
Have a nice day!
cronoik
 
Posts: 288
Joined: 2015-05-20 21:17

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

Postby bw123 » 2018-08-05 10:45

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

https://packages.debian.org/stretch/amd ... t/filelist
User avatar
bw123
 
Posts: 3578
Joined: 2011-05-09 06:02
Location: TN_USA

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

Postby Morales1235 » 2018-08-05 10:48

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.
Morales1235
 
Posts: 14
Joined: 2018-07-18 18:59

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

Postby debiman » 2018-08-06 08:48

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
User avatar
debiman
 
Posts: 3064
Joined: 2013-03-12 07:18

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

Postby arzgi » 2018-08-06 14:36

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
arzgi
 
Posts: 389
Joined: 2008-02-21 17:03
Location: Finland

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

Postby debiman » 2018-08-07 07:56

^ i guess you're trying to say something, but i don't know what.
User avatar
debiman
 
Posts: 3064
Joined: 2013-03-12 07:18

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

Postby arzgi » 2018-08-08 07:18

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.
arzgi
 
Posts: 389
Joined: 2008-02-21 17:03
Location: Finland

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

Postby debiman » 2018-08-11 10:07

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?
User avatar
debiman
 
Posts: 3064
Joined: 2013-03-12 07:18

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

Postby slayde » 2018-08-24 05:57

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.
slayde
 
Posts: 4
Joined: 2018-01-10 02:11

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

Postby debiman » 2018-08-26 06:52

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.
User avatar
debiman
 
Posts: 3064
Joined: 2013-03-12 07:18

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

Postby Morales1235 » 2018-10-19 17:43

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
Morales1235
 
Posts: 14
Joined: 2018-07-18 18:59

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

Postby Danielsan » 2018-10-20 05:04

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
Danielsan
 
Posts: 496
Joined: 2010-10-10 22:36

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

Postby debiman » 2018-10-21 12:18

^ 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...?
User avatar
debiman
 
Posts: 3064
Joined: 2013-03-12 07:18

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

Postby Morales1235 » 2018-10-22 15:21

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.
Morales1235
 
Posts: 14
Joined: 2018-07-18 18:59


Return to Desktop & Multimedia

Who is online

Users browsing this forum: No registered users and 6 guests

fashionable