diff options
author | Cullum Smith <cullum@sacredheartsc.com> | 2024-08-02 19:10:39 -0400 |
---|---|---|
committer | Cullum Smith <cullum@sacredheartsc.com> | 2024-08-02 19:10:39 -0400 |
commit | cbcd022f302adc39ecb89fba6faf72e68184c0e0 (patch) | |
tree | a5ab154e08fa3c4fa110b09d3475736c66840c8b /files/usr/local/libexec/thinkpad-brightness.laptop | |
parent | ceb339370d7a0cc4a83fe54103a650dfb3f72261 (diff) | |
download | infrastructure-cbcd022f302adc39ecb89fba6faf72e68184c0e0.tar.gz |
halfway working idm server and laptop hostclasses
Diffstat (limited to 'files/usr/local/libexec/thinkpad-brightness.laptop')
-rw-r--r-- | files/usr/local/libexec/thinkpad-brightness.laptop | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/files/usr/local/libexec/thinkpad-brightness.laptop b/files/usr/local/libexec/thinkpad-brightness.laptop new file mode 100644 index 0000000..16cc01a --- /dev/null +++ b/files/usr/local/libexec/thinkpad-brightness.laptop @@ -0,0 +1,31 @@ +#!/bin/sh + +cur=$(/usr/bin/backlight -q) + +case $1 in + up) + if [ "$cur" -ge 50 ]; then + delta=10 + elif [ "$cur" -ge 10 ]; then + delta=5 + else + delta=2 + fi + + /usr/bin/backlight incr "$delta" + ;; + down) + if [ "$cur" -le 10 ]; then + delta=2 + elif [ "$cur" -le 50 ]; then + delta=5 + else + delta=10 + fi + + /usr/bin/backlight decr "$delta" + ;; + *) + exit 1 + ;; +esac |