From 65b31ee29ead2a398c268fac811049188889b34b Mon Sep 17 00:00:00 2001 From: Piraty Date: Fri, 22 Oct 2021 23:07:06 +0200 Subject: [PATCH] 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 Signed-off-by: Piraty --- srcpkgs/acpid/files/handler.sh | 1 + srcpkgs/acpid/template | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/srcpkgs/acpid/files/handler.sh b/srcpkgs/acpid/files/handler.sh index df6b28a096..1ff368bc1e 100644 --- a/srcpkgs/acpid/files/handler.sh +++ b/srcpkgs/acpid/files/handler.sh @@ -9,6 +9,7 @@ step_backlight() { for backlight in /sys/class/backlight/*/; do [ -d "$backlight" ] || continue 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" done } diff --git a/srcpkgs/acpid/template b/srcpkgs/acpid/template index 24be7ddd93..ba9f0dc442 100644 --- a/srcpkgs/acpid/template +++ b/srcpkgs/acpid/template @@ -1,7 +1,7 @@ # Template file for 'acpid' pkgname=acpid version=2.0.33 -revision=1 +revision=2 build_style=gnu-configure short_desc="ACPI Daemon (acpid) With Netlink Support" maintainer="Enno Boland "