diff --git a/AutomaticBrightness.sh b/AutomaticBrightness.sh index aab7dd3..c4a8a68 100644 --- a/AutomaticBrightness.sh +++ b/AutomaticBrightness.sh @@ -42,11 +42,7 @@ else $(echo $OffSet > /tmp/AB.offset) fi - -if [[ $OffSet -lt 0 ]] -then - OffSet=0 -fi +OffSet=$((OffSet < 0 ? 0 : OffSet)) if [[ $op -lt 2 ]] @@ -58,10 +54,7 @@ then OffSet=$((OffSet - num)) fi - if [[ $OffSet -lt 0 ]] - then - OffSet=0 - fi + OffSet=$((OffSet < 0 ? 0 : OffSet)) $(echo $OffSet > /tmp/AB.offset)