Redshift – Nifty tool to reduce eye strain at night in Linux

We all knows, most of the electronic devices are emitting blue light which will impact our sleep badly, that too on night (after dark) but many of the people are working in night and long time at computer which leads to face so many eye related problems. To reduce or prevent eye related issues, I will advise you to use Redshift,  It’s  a nifty tool to reduce computer eye strain on Linux.

What’s Readshift ?

Redshift adjusts the color temperature of your screen according to your surroundings (position of the sun). It is inspired by f.lux. This will reduce eye strain when you are working in computer at night or long hours.

By default redshift uses GeoClue to obtain your location (I mean, Latitude and Longitude of your location) to start. If redshift doesn’t obtain the location from an automatic location provider then you need to specify your current location. Visit latlong.net to get your Latitude and Longitude.

A different color temperature is set during night and daytime. During twilight and early morning, the color temperature transitions smoothly from night to daytime temperature to allow your eyes to slowly adapt.

Night time color temperature is very low, between 3000K-4000K (default is 3700K) and the color temperature set to match the lamps in your room. During the day, the color temperature set to match the light from outside, typically around 5500K-6500K (default is 5500K).

Linux and Unix systems color temperature is set with an X server extension. The color temperature is changed by setting appropriate gamma ramps. Even, if you customize the gamma ramps, the system will overwritten the default one. If you care too much about color accuracy then blindly use this program.

Redshift will continuously update the color temperature at regular intervals. There is no configuration required for redshift, so simply install the app then leave. It will automatically do the job as you expect.

Make a note, Redshift only works with Xorg and Wayland is not supported yet but Gnome users can install with help of GNOME Shell extension.

How to install Redshift ?

Most of the major Linux distributions by default have the redshift package, so simple use the Package Manager to install it. Install both packages redshift & redshift-gtk, redshift-gtk provides a system tray icon to control Redshift easily.

For Debian users, use APT Package Manager or Apt-Get Package Manager to install Redshift.

$ sudo apt-get install redshift redshift-gtk

For openSUSE users, use Zypper Package Manager to install Redshift.

$ sudo zypper install redshift redshift-gtk

For Fedora users, use dnf Package Manager to install Redshift.

$ sudo dnf install redshift redshift-gtk

For Fedora 25 users, use dnf Package Manager to install Redshift.

$ sudo dnf copr enable mystro256/gnome-redshift
$ sudo dnf install gnome-shell-extension-redshift

For Arch Linux users, use pacman Package Manager to install Redshift.

$ sudo pacman -S redshift redshift-gtk

For CentOS/RHEL user, Enable EPEL Repository then use yum Package Manager to install Redshift.

$ sudo yum install redshift redshift-gtk

Launch Redshift by navigating application menu. After launch, you can’t see the interface and automatically added to Top/Bottom panel based on your desktop environment.

Click on the Redshift applet to bring up the list.

Here choose the info to see the status of Redshift.

To set one shot mode

After you start redshift, it will automatically get the location and set the color temperature of your screen according to your surroundings. Do you want to know more about redshift ? If yes, simple play around the options to find the right color temperature for you. To set one shot manual mode to set standard color temperature, use the capital -O option with redshift.

# redshift -O 3500

I have set 3500K color temperature, this is quit extreme because default night temperature for redshif is 3700K, anyhow keep change the temperature value until you found the suitable one.

How to set Day/Night time temperature ?

Add -t switch with redshift command to add Day and Night time temperature.

# redshift -t 5500:4000

Adjust screen brightness

Add -b switch with redshift command to adjus screen brightness (between 0.1 to 1.0).

# redshift -b 1.0:0.5

I have adjust the screen brightness 50% on night.

How to Set Latitude and Longitude

Add -l switch with redshift command to add Latitude and Longitude of your location. Visit latlong.net to get your Latitude and Longitude.

# redshift -l 12.971599:77.594563

I’m in Bangalore (India), so my coordinates are

Reset Mode

Add -x switch with redshift command to reset the adjustment to redshift default.

# redshift -x

Read more about redshift

If you want to know more option which is available for redshift, simply navigate to man page.

# redshift --help
or
# man redshift

Create Redshift configuration file

Redshift reads the configuration file~/.config/redshift.conf, if it exists. However, Redshift does not create that configuration file, so you have to create it manually. The following is an example of a configuration file, taken from Redshift website.

; Global settings for redshift
[redshift]
; Set the day and night screen temperatures
temp-day=5700
temp-night=3500

; 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.
transition=1

; Set the screen brightness. Default is 1.0.
;brightness=0.9
; It is also possible to use different settings for day and night
; since version 1.8.
;brightness-day=0.7
;brightness-night=0.4
; Set the screen gamma (for all colors, or each color channel
; individually)
gamma=0.8
;gamma=0.8:0.7:0.8
; This can also be set individually for day and night since
; version 1.10.
;gamma-day=0.8:0.7:0.8
;gamma-night=0.6

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

; 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.
adjustment-method=randr

; Configuration of the location-provider:
; type 'redshift -l PROVIDER:help' to see the settings.
; ex: 'redshift -l manual:help'
; Keep in mind that longitudes west of Greenwich (e.g. the Americas)
; are negative numbers.
[manual]
lat=12.97
lon=77.59

; Configuration of the adjustment-method
; type 'redshift -m METHOD:help' to see the settings.
; ex: 'redshift -m randr:help'
; In this example, randr is configured to adjust screen 1.
; Note that the numbering starts from 0, so this is actually the
; second screen. If this option is not specified, Redshift will try
; to adjust _all_ screens.
[randr]
screen=1

About Magesh Maruthamuthu

Love to play with all Linux distribution

View all posts by Magesh Maruthamuthu

One Comment on “Redshift – Nifty tool to reduce eye strain at night in Linux”

  1. Anyone know how to make redshift work with Nvidia proprietary drivers though? I can’t get f.lux or redshift working on my linux distro because of that.

Leave a Reply

Your email address will not be published. Required fields are marked *