From cbcd022f302adc39ecb89fba6faf72e68184c0e0 Mon Sep 17 00:00:00 2001 From: Cullum Smith Date: Fri, 2 Aug 2024 19:10:39 -0400 Subject: halfway working idm server and laptop hostclasses --- files/usr/local/libexec/thinkpad-brightness.laptop | 31 ++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 files/usr/local/libexec/thinkpad-brightness.laptop (limited to 'files/usr/local/libexec/thinkpad-brightness.laptop') 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 -- cgit v1.2.3