From ArchWiki
Revision as of 20:14, 8 January 2017 by Z3ntu (talk | contribs) (Troubleshooting: Add libappindicator-gtk3 section and fix intendation in other sections)
Jump to navigation Jump to search

From the redshift project web page:

Redshift adjusts the color temperature of your screen according to your surroundings. This may help your eyes hurt less if you are working in front of the screen at night. This program is inspired by f.lux.

The project is developed on GitHub.

Note: At the moment, Redshift only works with XorgWayland is not supported yet, see #If you are on Wayland.


Install the redshift package. Alternatively, install the redshift-minimalAUR package, for a version with minimal dependencies.

Desktop environments

For desktop environments, the redshift-gtk command is installed with the redshift package. redshift-gtk provides a system tray icon for controlling redshift and requires these three packages to work: python-gobject, python-xdg, and librsvg; all of them are listed as optional dependencies of the main redshift package. KDE users can use the plasma5-applets-redshift-control-gitAUR.


There are several options to have redshift automatically started:

  • By launching redshift with a script under /etc/X11/xinit/xinitrc.d/.
  • By using the provided systemd service unit files. Be careful: the service can only be started in user mode, see systemd/User#Basic setup. Two service files are provided: /usr/lib/systemd/user/redshift.service and /usr/lib/systemd/user/redshift-gtk.service. Activate only one of them depending on whether or not you want the system tray icon. The DISPLAY environment variable needs to be configured. See systemd/User#DISPLAY and XAUTHORITY.
  • By right-clicking the system tray icon when redshift-gtk or plasma5-applets-redshift-control is already launched and selecting 'Autostart'.
Note: The redshift services files contains Restart=always so the service will restart infinitely (see man systemd.service)


Redshift will at least need your location to start, meaning the latitude and longitude of your location. Redshift employs several routines for obtaining your location. If none of them works (e.g. none of the used helper programs is installed), you need to enter your location manually: For most places/cities an easy way is to look up the wikipedia page of that place and get the location from there (search the page for "coordinates").

Quick start

Tip: provides a service getting the Latitude and Longitude coordinates.

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.

Automatic location based on GPS

You can also use gpsd to automatically determine your GPS location and use it as an input for Redshift. Create the following script and pass $lat and $lon to redshift -l $lat;$lon:

#gpsdata=$( gpspipe -w -n 10 |   grep -m 1 lon )
gpsdata=$( gpspipe -w | grep -m 1 TPV )
lat=$( echo "$gpsdata"  | jsawk 'return' )
lon=$( echo "$gpsdata"  | jsawk 'return this.lon' )
alt=$( echo "$gpsdata"  | jsawk 'return this.alt' )
dt=$( echo "$gpsdata" | jsawk 'return this.time' )
echo "$dt"
echo "You are here: $lat, $lon at $alt"

For more information, see this forums thread.

Manual setup

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. Below is an example (copied from the Redshift website).

Note: There seems to be a bug in Redshift that causes the transition option in the configuration file to not work as described: Instead of handling the transition between day and night it only changes the transition between application start-up and shutdown (and delay the latter as a consequence). See the talk page and the issue on the Redshift project page for more information.
; Global settings for redshift
; Set the day and night screen temperatures (Neutral is 6500K)

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

; Set the location-provider: 'geoclue2' or '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 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.

Use real screen brightness

Redshift has a brightness adjustment setting, but it does not work the way most people might expect. In fact it is a fake brightness adjustment obtained by manipulating the gamma ramps, which means that it does not reduce the backlight of the screen. [1]

Changing screen backlight is possible with redshift hooks and xorg-xrandr and xorg-xbacklight but, please see Backlight#xbacklight as there are some limitations and you may have to find another method of controlling the backlight depending on your hardware.

You need to create a file in ~/.config/redshift/hooks and make it executable. You can use and edit this example.


# Set brightness via xbrightness when redshift status changes

# Set brightness values for each status.
# Range from 1 to 100 is valid
# Set fade time for changes to one minute

case $1 in
		case $3 in
				xbacklight -set $brightness_night -time $fade_time
				xbacklight -set $brightness_transition -time $fade_time
				xbacklight -set $brightness_day -time $fade_time


Screen 1 could not be found

Locate configuration-file "redshift.conf" in your distribution and change "screen 1" to "screen 0"

redshift-gtk will not start

redshift-gtk requires optional dependencies to work correctly. To verify any missing dependencies, run redshift-gtk in the command line. Similar output to the following would be produced:

Traceback (most recent call last):
  File "/usr/bin/redshift-gtk", line 26, in <module>
    from redshift_gtk.statusicon import run
  File "/usr/lib/python3.4/site-packages/redshift_gtk/", line 31, in <module>
    from gi.repository import Gtk, GLib
ImportError: No module named 'gi.repository'

If this is the case, installing python-gobject, python-xdg, and librsvg packages solves this issue.

Left/right clicking the tray icon doesn't work

Install libappindicator-gtk3. See [2] and [3]

Failed to run Redshift due to geoclue2

Note: Prior to apply the method below, close redshift-gtk and restart the geoclue service. Sometimes the location service fails due to e.g. connection established after the location service.

If using Gnome, you can also toggle Location Services to "On" in "Settings -> Privacy"

By default, the geoclue2 configuration files does not allow Redshift access. In order to allow access, add the following lines to /etc/geoclue/geoclue.conf


If you cannot get redshift to autostart in i3

You can add this to your i3 config file.

exec --no-startup-id redshift-gtk

If you are on Wayland

At the moment running redshift has no effect under Wayland, because gamma correction is not available there[4]. There is an open feature request on their issue tracker.[5]

If you are running Gnome, you can try your luck with gnome-shell-extension-redshift-native-gitAUR. Install the aur package, restart Gnome and enable the Gnome Redshift Extension.

See also || sctAUR