Whats gobright anyway?
- Minimum brightness, so no matter how many times you invoke the command brightness may not go down a certain limit.
- Maximum brightness, so brightness may not go above certian limit.
- Support incrementing/decrementing brightness or setting it at certain level
- Free and opensource
gobright set brightness by writing brightness percentage in /sys/class/backlight/intel_backlight/brightness on debian, the brightness file can be specified on commandl line options, please note that gobright needs ROOT privilages so its can write to brightness file which is owned by ROOT, you can run it by non-ROOT user using setuid (see installation below).
- The source code is available on github you can build it like any golang program, also pre-built binary are provided for your convenient in most common architectures.
git clone https://github.com/coder-me/gobright.git
- Put gobright binary in your search path, in $HOME/bin or /usr/bin
- Let the ROOT owns it.
sudo chown root:root /usr/bin/gobright
- Finally setuid bit so it can be run by everybody.
sudo chmod 4555 /usr/bin/gobright
Usage of gobright: -decr Decrement brightness percentage by value -file string file where to write new brightness value (default "/sys/class/backlight/intel_backlight/brightness") -incr Increment brightness percentage by value -max int Max brightness percentage (default 100) -min int Min brightness percentage (default 10) -quiet Be Quiet -value int Set brightness value, or decr/incr brightness by value based on (-incr/-decr) flags (default 50)
- To set brightness to 50% just run
- To decrement brightness by 3% run
gobright -value 3 -decr
- To increment brightness by 10% run
gobright -value 10 -incr
- To black out your screen run
gobright -value 100 -min 0 -decr
- To set brightness 100% run
gobright -value 100
- Display Command options help