From 0a836efaba64a1aeb7677eacd29d7bcdc37aa679 Mon Sep 17 00:00:00 2001 From: Alexander Rosenberg Date: Thu, 4 May 2023 15:05:08 -0700 Subject: [PATCH] pdate battery-notify.sh --- battery-notify.sh | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/battery-notify.sh b/battery-notify.sh index 4d9086b..799c463 100755 --- a/battery-notify.sh +++ b/battery-notify.sh @@ -9,11 +9,7 @@ if [[ "$(uname)" = 'Linux' ]]; then function is_adapted_connected { let connected="$(cat /sys/class/power_supply/ADP1/online)" - if ((${connected} == 1)); then - echo true - else - echo false - fi + ((${connected} == 1)) } # Linux ends here else @@ -29,7 +25,7 @@ local did_notify=false while true; do let battery_percent="$(get_battery_percent)" - if ((${battery_percent} > 10)) || "$(is_adapted_connected)"; then + if ((${battery_percent} > 10)) || is_adapted_connected; then did_notify=false elif ! ${did_notify}; then did_notify=true