From 3153ca60417247490d127a9ec62b9173f2636737 Mon Sep 17 00:00:00 2001 From: dogeystamp Date: Mon, 12 Jun 2023 15:33:28 -0400 Subject: [PATCH] battwatch.sh: added --- src/.local/bin/deskutils/battwatch.sh | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100755 src/.local/bin/deskutils/battwatch.sh 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