Created
June 18, 2018 19:36
-
-
Save dedeibel/a32b7c8e8af68db96543dd5f12004b85 to your computer and use it in GitHub Desktop.
thinkpad t440p brightness control debian
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# | |
# t440p brightness control | |
# /etc/acpi/brightness | |
bl_dev=/sys/class/backlight/intel_backlight | |
bl=${bl_dev}/brightness | |
step=200 | |
curval=`cat $bl` | |
maxval=`cat /sys/class/backlight/intel_backlight/max_brightness` | |
case "$1" in | |
-) let "step=step*-1";; | |
+) ;; | |
*) exit 1;; | |
esac | |
let "newval=curval+step" | |
if [ $newval -gt $maxval ]; then | |
newval=$maxval | |
elif [ $newval -lt 0 ]; then | |
newval=0 | |
fi | |
echo $newval > $bl | |
# $ cat /sys/class/backlight/intel_backlight/brightness | |
# 1440 | |
# $ cat /sys/class/backlight/intel_backlight/max_brightness | |
# 4794 | |
# $ cat /sys/class/backlight/intel_backlight/actual_brightness | |
# 1440 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# /etc/acpi/events/thinkpad-brightness-down | |
event=video/brightnessdown | |
action=/etc/acpi/brightness - |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# /etc/acpi/events/thinkpad-brightness-up | |
event=video/brightnessup | |
action=/etc/acpi/brightness + |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment