Ubuntu: Why I can't add redshift to startup?



Question:

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


Solution:1

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.


Solution: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.


Solution:3

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.  

Note:If u also have question or solution just comment us below or mail us on toontricks1994@gmail.com
Previous
Next Post »