pdate battery-notify.sh
This commit is contained in:
parent
b4aecb0cee
commit
0a836efaba
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user