misc/scripts/brightness
2019-01-27 11:37:34 +01:00

28 lines
421 B
Bash
Executable File

#!/bin/sh
# set backlight brightness level
current=$(cat /sys/class/backlight/intel_backlight/brightness)
if test -z "$1"; then
echo $current
exit 0
fi
case "$1" in
'+' | '-')
if test -z "$2"; then
echo "missing increment"
exit 1
fi
new=$(("$current" "$1" "$2"))
;;
*)
echo "invalid argument '$1'"
exit 1
;;
esac
echo "current: $new"
echo $new > /sys/class/backlight/intel_backlight/brightness