From dbee0aab13c3dff4bac390f3ba75da9b3d55322d Mon Sep 17 00:00:00 2001 From: zachir Date: Thu, 9 Feb 2023 11:08:45 -0600 Subject: add backlight generic command (light or xbacklight) --- bl | 47 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 bl 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 -- cgit v1.2.3