From 1addc1ed468ce750e8e5cb4b6e647921a88ee5f1 Mon Sep 17 00:00:00 2001 From: Colin Powell Date: Thu, 13 Jan 2022 10:10:44 -0500 Subject: [PATCH] [bin] Fix fade going to 0 --- bin/.bin/fade | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bin/.bin/fade b/bin/.bin/fade index c0e570a..6b60c68 100755 --- a/bin/.bin/fade +++ b/bin/.bin/fade @@ -2,12 +2,12 @@ hostname=`hostname` max_brightness=`cat /sys/class/backlight/intel_backlight/max_brightness` brightness=`cat /sys/class/backlight/intel_backlight/brightness` -step=$(( max_brightness / 6 )) +step=$(( max_brightness / 8 )) inc=2 low_delta=$(( brightness - step )) high_delta=$(( brightness + step )) -if ( [ $1 = 'down' ] && [ $low_delta -gt 0 ] ) || ( [ $1 = 'up' ] && [ $high_delta -lt $max_brightness ] ) +if ( [ $1 = 'down' ] && [ $low_delta -ge $step ] ) || ( [ $1 = 'up' ] && [ $high_delta -le $max_brightness ] ) then for i in $(seq $step); do case $1 in