pdate battery-notify.sh

This commit is contained in:
Alexander Rosenberg 2023-05-04 15:05:08 -07:00
parent b4aecb0cee
commit 0a836efaba
Signed by: Zander671
GPG Key ID: 5FD0394ADBD72730

View File

@ -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