f.lux and redshift: Solutions for computer induced eye strain and sleep disorder

Night-time exposure to blue light keeps people up late. Experimental research suggests that an average person reading on a tablet for a couple hours before bed may find that their sleep is delayed by about an hour. In 2012, the American Medical Association’s Council on Science and Public Health made this recommendation:

Recognizes that exposure to excessive light at night, including extended use of various electronic media, can disrupt sleep or exacerbate sleep disorders, especially in children and adolescents. This effect can be minimized by using dim red lighting in the nighttime bedroom environment.


f.lux adjusts colors in a way that greatly reduces the stimulating effects of blue light at night. f.lux changes the color temperature of your display. Natural light is more blue, while most artificial light (including candlelight) is warmer. Incandescent bulbs, which we’re all used to, become more red in tone when you dim them. But newer LEDs and CFLs don’t – this includes the backlight on your monitor.

The term color temperature is a way to numerically describe how much red or blue light is illuminating a room. Color temperature is measured in Kelvins, and is determined by the kind of light you’re using. Confusingly, warmer (more red) light sources are described in lower degrees Kelvin. Compared to indoor lighting, daylight is cool – very blue. A candle is around 1800K, while a sunny day might be 6000K. An overcast day is more blue, so it might be around 7000K. Most computer monitors display around 6500K. If you are using incandescent task lights behind your computer, those are around 3000K.

During the daylight hours, f.lux keeps your monitor relatively cool with a default color temperature of 6500K. Your brain tends to associate blue light with daylight. At night, f.lux dials down the color temperature to a warmer, more yellow glow (3400K). You can also choose from presets:
Ember: 1200K
Candle: 1900K
Warm Incandescent: 2300K
Incandescent: 2700K
Halogen: 3400K
Fluorescent: 4200K
Daylight: 5500K
or adjust the settings to another specific preference. In general, the yellower the light, the less straining it is on your eyes. f.lux support kelvin color between 2000-10000K.

The best way to set f.lux is to adjust it in the environment you usually work in during the day and night. First, bring up a blank white text screen and adjust the color temperature of your display by trying to match the color of a white wall in the room. Once they match in both lighting environments, you’re on your way to much happier eyes.

Installing f.lux on Ubuntu 13.10

sudo add-apt-repository ppa:kilian/f.lux
sudo apt-get update
sudo apt-get install fluxgui

How to use

Find latitude and longitude of your location using http://justgetflux.com/map.html

xflux -l <latitude> -g <longitude> -k <color temparatature in Kelvin, default 3400>


$ xflux -l 23.70 -g 90.40
Welcome to xflux (f.lux for X)
This will only work if you're running X on console.

Your location (lat, long) is 23.7, 90.4

Your night-time color temperature is 3400
It's night time. Your screen is changing now.
Going to background: 'kill 24712' to turn off.

Turn off f.lux

$sudo killall xflux


You can also check out Redshift which is an open source application that does the same thing, its development was inspired by f.lux. As of Jan 4, 2014 the current version is 1.8.

Installing redshift 1.8 on ubuntu 13.10:

1. Download and extract redshift 1.8 in desired folder.

sudo make install

3. Create redshift.conf in ~/.config folder, example is given here, also providing my one below:

; Global settings for redshift
; Set the day and night screen temperatures

; Enable/Disable a smooth transition between day and night
; 0 will cause a direct change from day to night screen temperature. 
; 1 will gradually increase or decrease the screen temperature

; Set the screen brightness. Default is 1.0
; It is also possible to use different settings for day and night since version 1.8.
; Set the screen gamma (for all colors, or each color channel individually)

; Set the location-provider: 'geoclue', 'gnome-clock', 'manual'
; type 'redshift -l list' to see possible values
; The location provider settings are in a different section.

; Set the adjustment-method: 'randr', 'vidmode'
; type 'redshift -m list' to see all possible values
; 'randr' is the preferred method, 'vidmode' is an older API
; but works in some cases when 'randr' does not.
; The adjustment method settings are in a different section.

; Configuration of the location-provider:
; type 'redshift -l PROVIDER:help' to see the settings
; ex: 'redshift -l manual:help'

; Configuration of the adjustment-method
; type 'redshift -m METHOD:help' to see the settings
; ex: 'redshift -m randr:help'
; In this example, vidmode is configured to adjust screen 1. 
; Note that the numbering starts from 0, so this is actually the second screen.

4. run redshift

$/usr/local/bin/redshift &

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s