From 4dcfff1e04ad38f36ba14ee68f4477f88ff3b227 Mon Sep 17 00:00:00 2001 From: clsr Date: Fri, 7 Aug 2020 09:45:02 +0200 Subject: Ensure that increment or decrement changes raw backlight value --- bl | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/bl b/bl index c928519..d66422b 100755 --- a/bl +++ b/bl @@ -121,6 +121,11 @@ get_raw_new() { esac if [ -n "$new" ]; then : $(( raw_new = new * raw_max / max )) + if [ "$new" -lt "$curr" ] && [ "$raw_new" -ge "$raw_curr" ]; then + : $(( raw_new = raw_curr - 1 )) + elif [ "$new" -gt "$curr" ] && [ "$raw_new" -le "$raw_curr" ]; then + : $(( raw_new = raw_curr + 1 )) + fi fi if [ -n "$raw_new" ]; then if [ "$raw_new" -gt "$raw_max" ]; then -- cgit