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