Turn on night mode with xrandr

Create a script file night_mode

#!/bin/sh

night_mode() {
    xrandr --output VGA-1 --gamma $1 --brightness $2
}
case $1 in
  off) night_mode 1:1:1 1.0 ;;
  *) night_mode 1:0.85:0.6 1.0 ;;
esac

Add execute permission

$ chmod +x night_mode

Then just run ./night_mode to turn on night mode, and ./night_mode off to turn it down.

You can add this script to /usr/bin, so you can call it everywhere as a command.

See also

comments powered by Disqus