Multimonitor redshift

So something I’ve been taking very seriously lately is sleep hygiene. Part of that involves changing small parts of my life that affect sleep quality, and doing research into all the different things that do this.

I found F.lux recently and it’s been awesome. It adjusts the “warmth” of your monitor so that light from your monitor won’t have an adverse affect on your body’s internal clock. I can really feel the difference at night. The one problem is that F.lux doesn’t work on multiple monitors on linux…so there’s an alternative, called Redshift. This was supposed to work but I tried both 1.5 and 1.7 versions and they both don’t work. However, it does come with a handy command line flag to set which screen to do. So maybe there’s some stupid bug with my build that’s preventing it from affecting both of my monitors because apparently other people have redshift working perfectly.

So I wrote a bash script

for i in {0,1}

do

   redshift -l 42.21:71.5 -m vidmode:screen=$i

done

except this executes the commands one after another, and if I put this in my “startup programs”, it only runs on one monitor because it’s waiting for the first redshift program to stop. So I just made two different scripts that just had

redshift -l 42.21:71.5 -m vidmode:screen=0

and

redshift -l 42.21:71.5 -m vidmode:screen=1

and I run them both at startup.

And now both my monitors are adjusted to the time of day :D Feels good man.

Tags: oneyeardev