Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I have installed Redshift on my computer, and it works fine with the command gtk-redshift However it won't start up automatically when using the same command in startup applications. How do I set it to automatically start?

share|improve this question
add comment

4 Answers

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.

1) Use http://itouchmap.com/latlong.html or any other service to find your latitude/longitude

2) Adjust the startup command of redshift to: gtk-redshift -l <latitude>:<longitude>

Example of latitude/longitude of Amsterdam for redshift: gtk-redshift -l 52.37:4.9

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.

share|improve this answer
    
would it start if I used the GNOME-clock method? –  Dandyman Mar 10 '12 at 21:11
    
I'm not sure, you could try it but the steps outlined above apparently work.. –  Mark Rooney Mar 10 '12 at 21:17
    
I've now tried it with both the gnome-clock and manual methods, and it won't start on either –  Dandyman Mar 12 '12 at 18:54
    
Well if you have tried the method above and it does not work I'm out of suggestions. As I said this is a bug in Redshift so you may well just have to wait for it to be resolved by the Redshift developer. –  Mark Rooney Mar 13 '12 at 20:38
add comment

Create a file named redshift.conf in ~/.config and add your co-ordinates to it. It should end up looking something like this:

[redshift]
location-provider=manual
[manual]
lat=55.0
lon=12.0
share|improve this answer
1  
Add [redshift] at the top to make this config file work (see "info redshift") –  Adversus Dec 29 '13 at 22:09
add comment

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.

share|improve this answer
add comment

I would suggest two ways:

  1. Using crontab
  2. Using upstart

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

crontab -l

To edit the list type

crontab -e

Add this line in the end, to boot redshift whenever computer starts up

@reboot export DISPLAY=:0.0 && /usr/bin/redshift -l 56.20:16.35

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 the exit in the file or else it won't run. You can find the path by typing whereis redshift. The file should look similar to this:

#!/bin/sh -e
pcscd
#
# rc.local
#
# This script is executed at the end of each multiuser runlevel.
# Make sure that the script will "exit 0" on success or any other
# value on error.
#
# In order to enable or disable this script just change the execution
# bits.
#
# By default this script does nothing.

/usr/bin/redshift

exit 0

Save and reboot.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.