diff options
author | clsr <clsr@clsr.net> | 2020-08-07 09:45:02 +0200 |
---|---|---|
committer | clsr <clsr@clsr.net> | 2020-08-07 09:45:02 +0200 |
commit | 4dcfff1e04ad38f36ba14ee68f4477f88ff3b227 (patch) | |
tree | e41ec0a3161148b059924cfe3c184d75a314cd39 | |
parent | dd26c2292ec7ca5385c99738f390ee7015451c4a (diff) | |
download | bl-4dcfff1e04ad38f36ba14ee68f4477f88ff3b227.tar.gz bl-4dcfff1e04ad38f36ba14ee68f4477f88ff3b227.zip |
Ensure that increment or decrement changes raw backlight value
-rwxr-xr-x | bl | 5 |
1 files changed, 5 insertions, 0 deletions
@@ -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 |