Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # cat /etc/acpi/actions/brightness.sh
- #! /bin/bash
- case $1 in
- -|+) ;;
- *) exit 1;;
- esac
- dev=/sys/class/backlight/intel_backlight
- max=$(< $dev/max_brightness)
- cur=$(< $dev/brightness)
- step=$(( max / 50 ))
- test $((cur * 100 / max)) -lt 21 && step=$(( max / 200 ))
- brightness=$((cur $1 step))
- test "$brightness" -lt 0 && brightness=0
- test "$brightness" -gt "$max" && brightness="$max"
- echo "$brightness" > $dev/brightness
- # cat /etc/acpi/events/brightness_down
- event=video.brightnessdown
- action=/etc/acpi/actions/brightness.sh -
- # cat /etc/acpi/events/brightness_up
- event=video.brightnessup
- action=/etc/acpi/actions/brightness.sh +
- // (c) Artem S. Tashkinov Jul 23 2016 10:03 GMT
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement