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: 12
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: 273
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: 3392
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: 12
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: 2900
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: 387
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: 2900
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: 387
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: 2900
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: 2900
Joined: 2013-03-12 07:18


Return to Desktop & Multimedia

Who is online

Users browsing this forum: No registered users and 7 guests

fashionable