merge: work

This commit is contained in:
AngeD 2022-08-17 09:58:31 +02:00
parent 544258de34
commit 82cf039bc1
6 changed files with 27 additions and 17 deletions

View file

@ -5,8 +5,10 @@ shopt -s extglob nullglob
set_brightness() {
MAX="$(cat "$1"/max_brightness)"
FILE="$1"/brightness
VAL="$(($2 * MAX / 100))"
VAL="$(($2 * MAX / 100 + 1))"
[ "$VAL" -lt 0 ] && VAL=0
[ "$VAL" -gt "$MAX" ] && VAL="$MAX"
echo "$VAL" > "$FILE"
}