6

About redshift:

Redshift adjusts the color temperature of your screen according to your surroundings.

A typical redshift command that I use is redshift -O 9999 which sets the screen color temperature at 9999K. Following a polyphasic sleep schedule, I prefer to change my screen color a few times a day.

So here's part of my crontab:

LOW='redshift -O 1000'
HIGH='redshift -O 9999'

30 4 * * * $LOW
45 12 * * * $LOW
45 20 * * * $LOW
0 6,15,23 * * * $HIGH

It doesn't do anything. I checked the syslog, it does run, but when I catch the output in a file, the file is empty.

Why does this not work? Are there any alternatives to Redshift I could try?

1
  • 2
    Commands ran from cron don't have the shell environment variables such as DISPLAY set. Consider what happens when you replace your command in cron with env. You need to set the DISPLAY variable.
    – Dan D.
    Jul 17, 2013 at 0:14

1 Answer 1

6

Thanks Dan D. This worked:

LOW='redshift -O 1000'
HIGH='redshift -O 9999'
DISPLAY=:0.0

30 4 * * * $LOW
45 12 * * * $LOW
45 20 * * * $LOW
0 6,15,23 * * * $HIGH
1
  • how did this work? Didn't the comment from Dan D. say cron doesn't work for redshift?
    – xdavidliu
    Mar 13, 2018 at 17:17

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .