diff --git a/src/.local/bin/deskutils/battwatch.sh b/src/.local/bin/deskutils/battwatch.sh new file mode 100755 index 0000000..a78124c --- /dev/null +++ b/src/.local/bin/deskutils/battwatch.sh @@ -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