2

recently, I have discovery redshift (help your eyes hurt less if you are working in front of the screen at night)

I can run the tools using command line : redshift-gtk

I run "startup manager" : enter image description here

and I have add an entry :

enter image description here

And when I restart my computer, redshift does not start when I start my computer

Nymeria
  • 1,429
  • 1
  • 12
  • 19

3 Answers3

2

You could add a cron job.

Run the command:

crontab -e

Scroll to the bottom, and add this line

@reboot redshift-gtk

Then press enter (so you have a blank line below). That should now run at startup.

Tim
  • 32,861
  • 27
  • 118
  • 178
  • Hello, I have do this and when I reboot, pgrep redshift return nothing, it's don't work – Nymeria Aug 20 '14 at 07:48
  • It must be a problem with redshift. Try /usr/bin/redshift instead of redshift. Or use a different program - I use flux. – Tim Aug 20 '14 at 07:49
  • /usr/bin/redshift don't work too. I think I will do it but redshift is open source, not Flux – Nymeria Aug 20 '14 at 07:54
  • 1
    /usr/bin/redshift starts redshift without interface (see comments on the post) – Jacob Vlijm Aug 20 '14 at 07:55
  • Yes, but a process with redshift name must be created, right ? – Nymeria Aug 20 '14 at 08:00
  • As long as you have already set it up, even with no gui it should still work. – Tim Aug 20 '14 at 08:01
  • 1
    @Nymeria absolutely (I know because I killed it :)) and Tim: it should indeed. (it does here, and if I add it to startup applications, it works here as well) – Jacob Vlijm Aug 20 '14 at 08:02
  • This method worked for me, but additionally, I added redshift twice to the startup applications, just in case this doesn't work for anyone they could try this. – jac1013 Aug 26 '15 at 16:26
2

According to this link, it is the result of a bug. However: as suggested on the page, you can try to install geoclue-hostip, which was a solution for at least some of the users.

sudo apt-get install geoclue-hostip

Note: geoclue-hostip was installed on my system, that could be the reason why I could not reproduce the problem.

Jacob Vlijm
  • 83,767
2

I had plenty of issues trying to get redshift-gtk to autostart on my laptop (running Mint KDE 18). In the end I manged to get the right systemd configuration settings...

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

[Service]
Type=simple
Environment=DISPLAY=:0
ExecStart=/usr/bin/redshift-gtk -l 51.5:-0.1
Restart=on-failure
RestartSec=2

[Install]
WantedBy=default.target

This should be saved as a user unit configuration file here:

~/.config/systemd/user/redshift-gtk.service

You can test the above by running:

systemctl --user start redshift-gtk

You should be able to see redshift-gtk working, or you can check that it is working by running:

systemctl --user status redshift-gtk

NOTE: see the listing at the bottom for example output.

Assuming the redshift-gtk service started correctly, you can set it to run automatically as part of the initial user login:

systemctl --user enable redshift-gtk

You can check that has worked correctly by running:

systemctl --user list-dependencies default.target

This should show something like the following (note the second line, directly below default.target):

default.target
● ├─redshift-gtk.service
● └─basic.target
●   ├─paths.target
●   ├─sockets.target
●   └─timers.target

Now when you restart you should see redshift-gtk working, but again you can check by running:

systemctl --user status redshift-gtk

Which should produce something like the following:

● redshift-gtk.service - Redshift display colour temperature adjustment
   Loaded: loaded (/home/robin/.config/systemd/user/redshift-gtk.service; enabled; vendor preset: enabled)
   Active: active (running) since Sat 2016-11-05 17:07:28 GMT; 47s ago
     Docs: http://jonls.dk/redshift/
 Main PID: 2074 (redshift-gtk)
   CGroup: /user.slice/user-1000.slice/user@1000.service/redshift-gtk.service
           └─2074 /usr/bin/redshift-gtk -l 51.5 -0.1

Nov 05 17:07:28 rksd-dev-01 systemd[1801]: redshift-gtk.service: Service hold-off time over, scheduling restart.
Nov 05 17:07:28 rksd-dev-01 systemd[1801]: Stopped Redshift display colour temperature adjustment.
Nov 05 17:07:28 rksd-dev-01 systemd[1801]: Started Redshift display colour temperature adjustment.
Robin
  • 123