How To Adjust Screen Brightness With The Redshift CLI

Redshift is one of two good options for blue light filtering on Ubuntu Linux. F.lux is the other.

Filtering blue light is believed to reduce eye strain and offset some of artificial light’s disruptive effects on our circadian rhythm.

Installing Redshift and Redshift-gtk

Redshfit is a command line interface (CLI) although Redshift-gtk provides a notification area icon which can be used to enable/disable the filtering, suspend filtering for a time period, and see the current screen temperature in Kelvin (K).

Redshift is in the main Ubuntu repositories, so no third party PPAs need to be added.

To install Redshift:

sudo apt-get install redshift

And to pick up the notification icon:

sudo apt-get install redshift-gtk

Highlights of the Redshift Man Page

Like most popular Linux CLIs, Redshift has a man page which can be accessed by typing

man redshift

into a terminal.

Most users will want redshift to run on system launch and to set up a configuration file. This should be created at:

/home/foo/.config/redshift.conf

Mine is minimalist:

[redshift]
temp-day=4000
temp-night=3400
gamma=0.8
brightness=0.9
adjustment-method=randr
location-provider=manual
[manual]
lat=31.79
lon=35.21

How To Find Your Right Settings

It’s worth spending a bit of time after you’ve installed Redshift experimenting with two variables:

  • The level of blue light filtering that suits you
  • The screen brightness that suits you

I find that when both are optimal, my viewing comfort is greatly improved — particularly when spending long hours working on documents.

Finding the right temperature simply involves plugging a few commands into the terminal and some trial and error.

To see what a screen temperature of 4000K looks like use the -O argument which the man page describes as “one shot manual mode”:

redshift -O 4000

To clear the blue light filtering:

redshift -x

To move from one level of blue light filtering from the next, you can either clear the filter and set a new one using the commands above in reverse order. Alternatively, more elegantly, you use -P with the man page describes as “reset existing gamma ramps before applying new color effect.”

E.g. to move to 4000K from 4200K in one command:

redshift -P -O 4000

Setting Screen Brightness

The final Redshift setting that I think is worth knowing about is setting the screen brightness. This variable can be passed to the configuration file and also set randomly.

The operator here is -b which can be a value between 0.1 and 1.0.

You can chain all these arguments together in one command. For instance:

redshift -P -O 4200 -b 0.8

To add this to your redshift.conf file, if you’re starting from a template, uncomment the brightness=1.0 line and set it to your preferred value.

There’s much more you can do with Redshift. But these are the commands and settings I use to improve my viewing comfort.