From a9d935789cecbdaaf4b19352277ce47e1626a9e9 Mon Sep 17 00:00:00 2001 From: steel99xl Date: Sat, 7 Oct 2023 14:40:48 -0400 Subject: [PATCH] Update AutomaticBrightness.sh improved comparison --- AutomaticBrightness.sh | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) 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)