From c976d0178f9b2fc05ab9a64f3ae28ee0a6b65417 Mon Sep 17 00:00:00 2001 From: David Runge Date: Fri, 6 May 2016 02:01:23 +0200 Subject: bin/brightness: Adding script to increase/decrease backlight. --- bin/brightness | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100755 bin/brightness diff --git a/bin/brightness b/bin/brightness new file mode 100755 index 0000000..192dc4c --- /dev/null +++ b/bin/brightness @@ -0,0 +1,23 @@ +#!/usr/bin/env bash +# Script to lower/ raise screen brightness using xbacklight (xorg-xbacklight) + +set -e -u + +export DISPLAY=:0 +x11user=$(w |grep -w :0 | cut -d " " -f1) +export XAUTHORITY=/home/$x11user/.Xauthority +step=5 + +if [ -x /usr/bin/xbacklight ]; then + if [ "$1" = "video/brightnessup" ] && [ $2 = "BRTUP" ]; then + xbacklight -inc "$step" + elif [ "$1" = "video/brightnessdown" ] && [ $2 = "BRTDN" ]; then + xbacklight -dec "$step" + else + exit 1 + fi +else + exit 1 +fi + +exit 0 -- cgit v1.2.3-70-g09d2