1
0
Fork 0

brightness-notify: allow setting brightness value

This commit is contained in:
Luca Bilke 2024-12-25 16:45:05 +01:00
parent 89ac120211
commit 9fd4749a81
Signed by: luca
GPG key ID: F6E11C9BAA7C82F5

View file

@ -8,7 +8,10 @@ round() {
oldbrightness="$(cat /sys/class/backlight/*/brightness)"
oldpercent="$(round "$oldbrightness * (100/255)")"
newpercent="$(round "$oldpercent + $1")"
case $1 in
-* | +*) newpercent="$(round "$oldpercent + $1")" ;;
*) newpercent=$1 ;;
esac
newbrightness="$(round "$newpercent * (255/100)")"
if [ "$newpercent" -gt "100" ]; then