Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

My eyes are a big fan of redshift.  Redshift changes your display's colour temperature to make it a lot easier on your eyes (especially in dark settings).

Now, you could install and use something like like redshift-gtk, which gives you a tray application which allows you to enable/disable redshift etc.  However,  on on my basic i3wm setup, I prefer to control redshift a bit more manually.

For A few reasons for this is:

  • I generally don't like extraneous extra processes and apps running;
  • I don't like tray apps in general (I don't know why... they just annoy me);
  • I like bindsym-ming stuff I use often (rather than running a memory-resident application continuously);

Below is a quick overview of how I implement redshift with i3wm.

...

Modify your i3 config

We're going to add a an i3 binding mode, which we will call with a bindsym ($mod+r for example).  This will show several options for controlling redshift (these options will usually show up at the bottom left of your screen).

...

Code Block
# redshift modes
bindsym $mod+r mode "$mode_redshift"
set $mode_redshift Set colour temperature: (a)uto, (r)eset, (2)500K, (3)000K, (4)000K, (5)000K
set $kill_redshift pgrep redshift | xargs kill pkill -9 redshift;
mode "$mode_redshift" {
    bindsym a exec --no-startup-id "$kill_redshift redshift -P -t 5000:4000", mode "default"
    bindsym r exec --no-startup-id "$kill_redshift redshift -x", mode "default"
    bindsym 2 exec --no-startup-id "$kill_redshift redshift -P -O 2500", mode "default"
    bindsym 3 exec --no-startup-id "$kill_redshift redshift -P -O 3000", mode "default"
    bindsym 4 exec --no-startup-id "$kill_redshift redshift -P -O 4000", mode "default"
    bindsym 5 exec --no-startup-id "$kill_redshift redshift -P -O 5000", mode "default"

    # exit mode: "Enter" or "Escape"
    bindsym Return mode "default"
    bindsym Escape mode "default"
}

...

Info

Note here that all options except (a)uto do not run redshift in memory as they use the oneshot flag (-O).  (a)uto mode simply runs the default redshift mode (which stays in memory and changes the temperature throughout the day).

Pressing $mod+r w should show something like the following option in the bottom-left of your screen:

...