acpid: fix backlight stepping for low values of max_brightness
appearently, max_brightness can be as low as 15, which makes the integer
division round down to 0.
Fixes: c101203b25
("acpid: cleanup handler")
Reported-by: slotThe <soliditsallgood@mailbox.org>
Signed-off-by: Piraty <piraty1@inbox.ru>
This commit is contained in:
parent
0a854ab1f2
commit
65b31ee29e
2 changed files with 2 additions and 1 deletions
|
@ -9,6 +9,7 @@ step_backlight() {
|
||||||
for backlight in /sys/class/backlight/*/; do
|
for backlight in /sys/class/backlight/*/; do
|
||||||
[ -d "$backlight" ] || continue
|
[ -d "$backlight" ] || continue
|
||||||
step=$(( $(cat "$backlight/max_brightness") / 20 ))
|
step=$(( $(cat "$backlight/max_brightness") / 20 ))
|
||||||
|
[ "$step" -gt "1" ] || step=1 #fallback if gradation is too low
|
||||||
printf '%s' "$(( $(cat "$backlight/brightness") $1 step ))" >"$backlight/brightness"
|
printf '%s' "$(( $(cat "$backlight/brightness") $1 step ))" >"$backlight/brightness"
|
||||||
done
|
done
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
# Template file for 'acpid'
|
# Template file for 'acpid'
|
||||||
pkgname=acpid
|
pkgname=acpid
|
||||||
version=2.0.33
|
version=2.0.33
|
||||||
revision=1
|
revision=2
|
||||||
build_style=gnu-configure
|
build_style=gnu-configure
|
||||||
short_desc="ACPI Daemon (acpid) With Netlink Support"
|
short_desc="ACPI Daemon (acpid) With Netlink Support"
|
||||||
maintainer="Enno Boland <gottox@voidlinux.org>"
|
maintainer="Enno Boland <gottox@voidlinux.org>"
|
||||||
|
|
Loading…
Reference in a new issue