How to Install and Use Redshift Ubuntu 16.04

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.

Read alsos-tui - Terminal Tool to Monitoring CPU Temperature in Linux

Points to note:

  1. Redshift does not support Wayland since it offers no way to adjust the color temperature.
  2. 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:
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
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)

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
$  ./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.

Configuring Redshift

There are two ways to launch Redshift on Ubuntu 16.04

  1. Using redshift cli command - redshift
  2. 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
; Set the day and night screen temperatures

; 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.

; 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.

; 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.

; 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)
; This can also be set individually for day and night since
; version 1.10.

; Set the location-provider: 'geoclue2', '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'
; Keep in mind that longitudes west of Greenwich (e.g. the Americas)
; are negative numbers.

; 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.

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.

Josphat Mutai 12:05 am

About Josphat Mutai

Red Hat Certified Engineer with more than 2 years experience managing critical Cloud Infrastructures and Services. Passionate about Technology and loves testing and reviewing gadgets and Open-source tools.

Author Archive Page

Have anything to say?

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

All comments are subject to moderation.