Is it possible to configure Redshift so that screen color changes at fixed hours regardless of actual Sun position? I'm using Redshift 1.10-5ubuntu1 on Ubuntu 16.04 and GNOME.
Is it possible to configure Redshift so that screen color changes at fixed hours regardless of actual Sun position? I'm using Redshift 1.10-5ubuntu1 on Ubuntu 16.04 and GNOME.
Redshift does provide custom fixed transition times in the redshift config file in
~/.config/redshift.conf
To set these times, add the fieldsdawn-time
anddusk-time
and add a time to set the time periods. My configuration file looks like this for example:According to this pull request:
Redshift doesn't provide an option to set day and night time.
What I did was set up a cron task to set the colour temperature every x minutes, according to the hour.
The command I use :
set the temperature at
TEMPERATURE
only once (Redshift won't run in background to compute if it as to change the temperature all the time).How to set the cron task
If you don't know how to use Vim (if you do you can jump this step), open a terminal (Ctrl+Alt+T) and change the default editor by running
Now close your terminal to apply.
Open a new terminal and run
to edit your cron task table.
Go to the end of the file and add this lines:
*/5
is the interval in minutes (every minute that can be divided by 5)17-7
and8-16
are the hour range (every hour between 5 p.m. and 7 a.m. for the night, and between 8 a.m. and 4 p.m. for the day)* * *
is the date (so every day [of the month], every month, and every day of the week).So, in my example, the first command (for night time) is executed every 5 minutes (0, 5, ..., 55) between 17:00 and 7:59 everyday, and the second command (for day time) every 5 minutes between 8:00 and 16:59.
The commands that follow are what is executed at the (previously) specified time :
DISPLAY=:0
is for running the command on a display (otherwise it is on background, which is useless in our case). Don't change it unless you are using an external monitor, most of the time the default display port is:0
.redshift -O TEMPERATURE
is the command we saw above, of course changeDAY_TEMP
andNIGHT_TEMP
to the temperatures you want for the day and for the night.>> /home/USER/cron.log 2>&1
redirects the (error) messages to/home/USER/cron.log
(that can be useful if your display is NOT on:0
). Change/home/USER
to your home directory.Exit your editor : if you did step 1., press Ctrl+X then Y and finally Enter.
Don't forget to remove Redshift from Startup Applications.
Now you are done.
Some side effects are : you won't have a GUI to suspend Redshift or to disable it ; there will be no transitions (it will change directly from
DAY_TEMP
toNIGHT_TEMP
) and that can be surprising if not unpleasant...