battwatch.sh: added

This commit is contained in:
dogeystamp 2023-06-12 15:33:28 -04:00
parent c6227f097c
commit 3153ca6041
Signed by: dogeystamp
GPG Key ID: 7225FE3592EFFA38

View File

@ -0,0 +1,12 @@
#!/bin/sh
# i didn't *really* feel like having a cronjob for this so
while true; do
BAT="$(acpi -b | head -n 1 | awk -F'[,:]' '{print $3}' | tr -d '[:space:]%')"
if [ "$BAT" -lt "10" ]; then
notify-send -u critical -a battery "currently at $BAT%"
elif [ "$BAT" -lt "20" ]; then
notify-send -a battery "currently at $BAT%"
fi
sleep 240
done