Download! Download back issues COMPLETELY FREE!

Ease eye strain and Sleep easier with Redshift

Dynamically adjust the whiteness of your screen to reduce eye fatigue

Why do this?

  • Sleep better.
  • See better.
  • It’s an excuse to revel in the brilliance of Lord Kelvin.

Too many of us work late into the night staring at a screen. And while the best solution is always going to be to work less, if you haven’t got that luxury Free Software can offer you the next best solution – a tool that adjusts the whiteness of your screen as day turns into evening and evening turns into night.

Not only will this reduce the fatigue on your eyes, it also helps reduce the stress on your precious neurons, helping tell your brain it’s not really midday but nearly time for bed. If that last sentence sounds more like alternative therapy, all we can suggest is that you try it for yourself, because it’s brilliant.

What Redshift does

Redshift is an open source tool that dynamically adjusts the white balance of your display over time. If you’re a photographer, you’ll already know what white balance is – it’s the process of adjusting the colour balance of a photo to ensure white is as neutral as possible, because the way white appears changes under different lighting situations. You don’t notice these changes because the brain automatically compensates for lighting conditions. It will keep on telling you something is white whether it’s lit by the midday sun or by a late evening sunset.

It’s only when you take a photo and look at that image under different lighting conditions that you might notice. Photographers take something they know is white from the photo and adjust the entire colour balance until it is. Redshift does the opposite, changing the colour balance of your screen as if it were lit from a different source.

Image

Install redshift

This may sound like Redshift is reducing the overall quality of your display but all it’s really doing is adjusting the white balance so that white now looks like it’s lit by the sun at the current time and date and also geographical location, or if it’s dark, the sun is replaced by lamp light. This is both easier on your eyes and helps trick your brain into preparing itself for the appropriate time of the day.

Redshift has become popular enough to have spawned several side-projects. It is itself the open source equivalent of a proprietary utility called f.lux, and you’ll need to avoid these when installing these from your distribution’s package manager. We’re going to stick with the simple redshift package to get things started and to explain some of its options; you can then go back and explore some of the alternatives if you like what it does.

Image

Colour temperature

With Redshift installed, execute it from the command-line by typing redshift -O 3000. The 3000 is using a unit of measurement for temperature called Kelvin, also used for white balance and colour temperature within screens, because black bodies (originally carbon in William Kelvin’s experiments) emitting heat at around 3,000 K look orange, whilst those of around 8,000 K look blue (as shown in the image – the black line is the change in colour as K increases). A neutral colour is considered to have a Kelvin value of 6500, and a candle burns at around 1900 K.

Image

Geolocation

Without any arguments, running redshift will attempt to detect your geographical location automatically using GeoClue, a D-BUS service that uses your network connections to determine your location locally. This is so it can adjust the colour temperature against the respective location of the sun at our latitude and longitude. After detecting your location, your screen’s colour temperature will adjust gradually moving between 3500 K for night and 6500 K in the day. If you add the -v option you can see how Redshift is changing, but after the initial transition, changes should happen so gradually that they’re not noticeable, so it’s only when you really do look at 6500 K light, such as a backlit keyboard or white LED, you’ll realise your eyes and brain had adjusted to the new status quo.

Image

Customise Kelvin and brightness levels

If GeoClue has any difficulty finding your location, you can manually enter your latitude and longitude by using the -l LAT:LONG argument. There are lots of online services that will take a postcode and turn it into your location. Another important option is the ability to change the colour temperatures your screen is going to shift between. This uses the argument -t, and we prefer a more extreme night value of 2800 K, which you can pass to Redshift with redshift -v -t 6500:2800. It’s worth looking up the Kelvin values for other kinds of lighting. Another additional argument is brightness adjustment. This isn’t the same as hardware brightness, and won’t really extend your battery life, but it gives you more granular control over your screen in low light. The argument for this is -b DAY:NIGHT, where day and night are values between 1.0 and 0.1.

Image

Use a GUI

Even though Redshift runs perfectly from the command line, and we’d recommend launching it and forgetting about it, there are numerous interfaces to its various functions. These can give you better control over the colours it produces and the times it produces them. Redshift-gtk, for example, adds an applet widget to remind you it’s running. Another option is Redshift-gui. This gives you a graphical indication of the sun’s position, lets you set a location, and fine-tune colour temperatures and transition speed – basically all the options you get from the command line, only from the convenience of your mouse. And whatever option you choose, typing redshift -x will always reset your screen to its default values. Redshift is one of the best utilities we’ve ever used. When you turn it off and look at real white again, you can’t believe your eyes.

Image