I have installed Redshift
on my computer and it works fine with the command gtk-redshift
.
However, it would not start up automatically when using the same command in startup applications.
How do I set it to automatically start?
I have installed Redshift
on my computer and it works fine with the command gtk-redshift
.
However, it would not start up automatically when using the same command in startup applications.
How do I set it to automatically start?
There is a known bug #868904 that stops Redshift starting automatically in 11.10 due to geoclue conflicts on startup.
See Comment #17 on the bug report for a possible solution of setting the location permanently on start up.
It is reportedly fixed in the package 1.7-1ubuntu2 but the Launchpad homepage for the project lists only 1.7-0ubuntu1 built 35 weeks ago.
You could try downloading direct from their website to see if it fixes the issue with a later version.
Create a file named
redshift.conf
in~/.config
and add your co-ordinates to it. It should end up looking something like this:I would suggest two ways:
CRONTAB
Crontab is a program that is running all the time. It has a list with programs and scripts and the exact dates or intervals that they should run. Crontab is used a lot by system administrators for making backups and automating tasks.
To see the list with the programs you can type
To edit the list type
Add this line in the end, to boot redshift whenever computer starts up
where 56.20:16.35 is the
LATITUDE:LONGITUTE
of your location. Save and reboot.UPSTART
Upstart is a program that amongst other things, looks in specific folders at bootup for scripts to be run. So we can just add our program in there to have it run in every booutup. Upstart is more low-level than crontab and you need root privileges.
To add redshift you simply have to edit
/etc/rc.local
file. Add the path to redshift before theexit
in the file or else it won't run. You can find the path by typingwhereis redshift
. The file should look similar to this:Save and reboot.
Connect your computer to internet and run
gtk-redshift
in Terminal.The output will be:
Once you get your Latitude and Longitude from above, Go ahead and Edit autostart config file for Redshift, which is found in "~/.config/autostart/"
In gedit window add "-l 18.98:72.83" next to "Exec=redshift-gtk"
where 18.98:72.83 is your LATITUDE:LONGITUTE
Save this file and Reboot.
Antoher workaround (comment #53) is to install
geoclue-hostip
.Even though on my setup (Ubuntu 13.04) the manual position workaround works, and I prefer it anyway because it allows me to indicate the location more precisely.
Quite an old question, but for those who might stumble upon it, a possible solution may simply be by removing geoclue and --if it doesn't already exist-- installing geoclue-2.0
Something like:
apt remove geoclue && apt install geoclue-2.0
Logout and log back in to see the changes.
p.s. if the colors are not telling, you can check whether redshift is running using the
ps
command. e.g.ps aux | grep redshift
Another way to do it:
create a config file, e.g.
/etc/redshift.conf
create a script that calls this file, e.g.
/usr/local/bin/redshift.sh
(chmod 755
afterwards)call this whenever the display manager starts. For LightDM, this would be a file at
/etc/lightdm/lightdm.conf.d/90-redshift.conf
:Another one way is to set up startup command for redshift with manually specified lon:lat like:
where xx - latitude, yy - longitude
Startup Application Screen:
Tested on Ubuntu 14.04LTS
Create the file
~/.xprofile
with the following content:The xprofile is executed at the beginning of the X user session, after you log in to the graphical shell (Unity or Gnome).
The command
redshift -PO 4200
sets the temperature to 4200K.You can test the script by logging out and then logging in.