summaryrefslogtreecommitdiff
path: root/bl
diff options
context:
space:
mode:
Diffstat (limited to 'bl')
-rw-r--r--bl47
1 files changed, 47 insertions, 0 deletions
diff --git a/bl b/bl
new file mode 100644
index 0000000..f220e4f
--- /dev/null
+++ b/bl
@@ -0,0 +1,47 @@
+#!/bin/sh
+
+## Backlight controller generic: use either light or xbacklight
+
+CMD=`crcparse bl`
+
+case "$CMD" in
+ "light")
+ case "$1" in
+ "-i")
+ light -A "$2"
+ ;;
+ "-d")
+ light -U "$2"
+ ;;
+ "-s")
+ light -S "$1"
+ ;;
+ "-g")
+ light -G
+ ;;
+ "*")
+ printf "$CMD: $1 not understood. Treating it as a direct command."
+ light "$@"
+ ;;
+ esac
+ ;;
+ "xbacklight")
+ case "$1" in
+ "-i")
+ xbacklight -inc "$2"
+ ;;
+ "-d")
+ xbacklight -dec "$2"
+ ;;
+ "-s")
+ xbacklight -set "$1"
+ ;;
+ "-g")
+ xbacklight -get
+ ;;
+ "*")
+ printf "$CMD: $1 not understood. Treating it as a direct command."
+ xbacklight "$@"
+ ;;
+ esac
+esac