diff options
author | zachir <zachir@librem.one> | 2023-02-09 21:23:03 -0600 |
---|---|---|
committer | zachir <zachir@librem.one> | 2023-02-09 21:23:03 -0600 |
commit | 3c8f6acf1df57b5eb09b1f95f886747ba14de4f8 (patch) | |
tree | 3677b9feedf6b0c17294088ceb74d51703d378ed | |
parent | 22e8f8c134dac828f997519dbf0bdba0d3a4abdc (diff) | |
parent | 4ec61c0f9527e4f0ecce57a8b869270d8a42734e (diff) |
Merge branch 'master' of git.zachir.xyz:zachir/generics
-rwxr-xr-x | bl | 47 |
1 files changed, 47 insertions, 0 deletions
@@ -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 "$2" + ;; + "-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 "$2" + ;; + "-g") + xbacklight -get + ;; + "*") + printf "$CMD: $1 not understood. Treating it as a direct command." + xbacklight "$@" + ;; + esac +esac |