Redshift is a tool inspired by f.lux used to adjust the color temperature of your screen according to your surroundings.
It makes the color of the screen display adapt to the time of the day, like sunlight during the day and warm at night. In this article we cover how to install and use redshift on Ubuntu 16.04.
This will help the user reduce eye strain and fatigue. You can imagine if you're working on a project at night with brightness on the screen matching that of sunlight, this could possibly have adverse effects on the eye. When using Redshift, at night, it will set the color temperature to match the lamps in your room hence reducing blue light radiation from the screen at night.
Redshift allows your eyes to slowly adapt, for example during the early morning, the color temperature transitions smoothly from night to daytime temperature to allow your eyes to slowly adapt. At night, Redshift sets the color temperature to a default value of 3700K and 5500K during the day.
Points to note:
- Redshift does not support Wayland since it offers no way to adjust the color temperature.
- GNOME provides features like Redshift out-of-the-box and has Wayland support.
Installing Redshift on Ubuntu 16.04
You can install Redshift on Ubuntu using the upstream apt package manager, using ppa, or by building the application from source files. Whichever you prefer will work fine. Let's look at these two ways of Installing Redshift, via apt and building from source.
Installing Redshift using the apt package manager
The easiest way to get redshift up and running on Ubuntu 16.04 is through apt installation method. The package to install is either redshift or redshift-gtk. If you do a search of packages on Ubuntu 16.04 with the name prefix redshift, you'll get:
# apt-cache search redshift gnome-shell-extension-redshift - redshift extension for GNOME Shell gtk-redshift - transitional dummy package plasma-applet-redshift-control - Adjusts the color temperature of your screen plasma-widget-redshift - Plasma widget for Redshift plasma-widget-redshift-dbg - Plasma widget for Redshift - debugging symbols redshift - Adjusts the color temperature of your screen redshift-gtk - Adjusts the color temperature of your screen with GTK+ integration
Default Desktop environment on Ubuntu is unity, so we'll install redshift and redshift-gtk package for UI.
$ sudo apt-get install redshift redshift-gtk
If you have KDE desktop environment, the additional packages that you should consider installing are plasma-applet-redshift-control and plasma-widget-redshift, just by:
$ sudo apt-get install plasma-widget-redshift plasma-applet-redshift-control
Installing Redshift from ppa
Another way to install Redshift, especially latest build is via ppa provided by dobey
# sudo add-apt-repository ppa:dobey/redshift-daily More info: https://launchpad.net/~dobey/+archive/ubuntu/redshift-daily Press [ENTER] to continue or ctrl-c to cancel adding it gpg: keyring `/tmp/tmpe3wq4b1i/secring.gpg' created gpg: keyring `/tmp/tmpe3wq4b1i/pubring.gpg' created gpg: requesting key AD555F67 from hkp server keyserver.ubuntu.com gpg: /tmp/tmpe3wq4b1i/trustdb.gpg: trustdb created gpg: key AD555F67: public key "Launchpad PPA for Rodney Dawes" imported gpg: Total number processed: 1 gpg: imported: 1 (RSA: 1) OK
Then proceed to install redshift:
$ sudo apt-get update $ sudo apt-get install redshift redshift-gtk
Installing Redshift by building it from source
If you're a developer and want to get the latest release of Redshift running on your machine, you should consider building the package from source code instead. Use the commands:
$ sudo apt-get install intltool $ wget -c https://github.com/jonls/redshift/releases/download/v1.10/redshift-1.10.tar.xz $ ./configure --prefix=$HOME/redshift/root --with-systemduserunitdir=$HOME/.config/systemd/user $ make $ sudo make install
After successful installation, let's see how to run and configure Redshift on Ubuntu 16.04.
There are two ways to launch Redshift on Ubuntu 16.04
- Using redshift cli command - redshift
- Using redshift graphical tool provided by redshift-gtk
To just get it up and running with a basic setup, issue:
$ redshift -l LAT:LON
where LAT is the latitude and LON is the longitude of your location. You can also use gpsd to automatically determine your GPS location and use it as an input for Redshift. Example is,
$ redshift -l 45:-48
When you start redshift, by default it will read its configuration file from ~/.config/redshift.conf. Create this file first.
$ vim ~/.config/redshift.conf
Sample input to the file looks like this:
; Global settings for redshift [redshift] ; Set the day and night screen temperatures temp-day=5700 temp-night=3500 ; Disable the smooth fade between temperatures when Redshift starts and stops. ; 0 will cause an immediate change between screen temperatures. ; 1 will gradually apply the new screen temperature over a couple of seconds. fade=1 ; Solar elevation thresholds. ; By default, Redshift will use the current elevation of the sun to determine ; whether it is daytime, night or in transition (dawn/dusk). When the sun is ; above the degrees specified with elevation-high it is considered daytime and ; below elevation-low it is considered night. ;elevation-high=3 ;elevation-low=-6 ; Custom dawn/dusk intervals. ; Instead of using the solar elevation, the time intervals of dawn and dusk ; can be specified manually. The times must be specified as HH:MM in 24-hour ; format. ;dawn-time=6:00-7:45 ;dusk-time=18:35-20:15 ; 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: '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=48.1 lon=11.6 ; 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 only screen 0. ; Note that the numbering starts from 0, so this is actually the first screen. ; If this option is not specified, Redshift will try to adjust _all_ screens. [randr] screen=0
Parameters to change are:
lat=48.1, lon=11.6 - replace with your correct latitude and longitude.
Since this file is heavily commented out, please take your time to read through it and see what you can change to fit your requirements. Once done with the changes, save the file and exit. We now have complete configurations to start using Redshift. To launch UI application, search it on your launcher and click its name.
That's all. Enjoy using Redshift.