command module
Version: v0.0.0-...-3c0a442 Latest Latest

This package is not in the latest version of its module.

Go to latest
Published: Jul 31, 2021 License: MIT Imports: 7 Imported by: 0



Tool to manually control monitor color temperature.


Pre requisites

Make sure to have redshift installed for your Linux system.

Using go
go install


redshiftctl (com.github.heisantosh.redshiftctl) 0.1.0

Tool to manually control monitor color temperature using redshft.

  redshiftctl COMMAND [ARG]

  toggle [STATE]       toggle redshift to state on or off, if not provided toggele current state
  load                 load the state of the configuration file
  increase TEMP        increase the color temperature by TEMP
  decrease TEMP        decrease the color temperature by TEMP
  set TEMP             set the color temperature to TEMP
  get STATE            get the value of the state, STATE can be state or temperature
  help                 print this help information

  Configuration file is ~/.config/redshiftctl/config.json

  Keys are
  # current state on, off
  # color temperature

Toggle current state
redshiftctl toggle
Toggle state on
redshiftctl toggle on
Set color temperature
redshiftctl set 4500
Decrease color temperature
redshiftctl decrease 500
Get the current color temperature
redshiftctl get temperature


This was initially designed for use in a polybar module. The goal was to support mappings for scroll up and scroll down actions to decrease and increase color temperatures respectively as well as toggling redshift on/off.

Polybar redshift

redshift module
type = custom/ipc
# When starting, restore state from last time.
hook-0 = redshiftctl load && ~/.config/polybar/default/bin/redshift/
# Toggle state on/off.
hook-1 = redshiftctl toggle && ~/.config/polybar/default/bin/redshift/
# Increase color temperature.
hook-2 = redshiftctl toggle on && redshiftctl increase 500 && ~/.config/polybar/default/bin/redshift/
# Decrease color temperature.
hook-3 = redshiftctl toggle on && redshiftctl decrease 500 && ~/.config/polybar/default/bin/redshift/

initial = 1

# Toggle on/off on left click.

click-left = polybar-msg -p %pid% hook redshift 2

# Increase color temperature on scroll up.

scroll-up = polybar-msg -p %pid% hook redshift 3

# Decrease color temperature on scroll down.

scroll-down = polybar-msg -p %pid% hook redshift 4 for module content

state=$(redshiftctl get state)

if [ "${state}" = "on" ]; then
    temperature=$(redshiftctl get temperature)
    echo "%{F#EC7875} %{F-}${temperature}"
    echo "%{F#42A5F5} %{F-}"


The Go Gopher

There is no documentation for this package.

Source Files

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL