Browse Source

[bin] Fix fade going to 0

Colin Powell 3 years ago
parent
commit
1addc1ed46
1 changed files with 2 additions and 2 deletions
  1. 2 2
      bin/.bin/fade

+ 2 - 2
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