aboutsummaryrefslogtreecommitdiff
path: root/scripts/battery_notif.sh
diff options
context:
space:
mode:
authorAargh Rai <aargh.rai+git@gmail.com>2026-08-06 00:29:36 +0530
committerAargh Rai <aargh.rai+git@gmail.com>2026-08-06 00:29:36 +0530
commit91a5f9790cfd4a98ee940633694fb512ecf24942 (patch)
treeb20bdd22e304234b6893e20d0ca5fbfd042f2184 /scripts/battery_notif.sh
parentced774e19c36fb3b0b33a3846e7c9cf874b0c206 (diff)
i3 > hyprland & x11 > wayland
Diffstat (limited to 'scripts/battery_notif.sh')
-rw-r--r--scripts/battery_notif.sh15
1 files changed, 15 insertions, 0 deletions
diff --git a/scripts/battery_notif.sh b/scripts/battery_notif.sh
new file mode 100644
index 0000000..e5f44e9
--- /dev/null
+++ b/scripts/battery_notif.sh
@@ -0,0 +1,15 @@
+#!/usr/bin/env bash
+while true; do
+ status=$(cat /sys/class/power_supply/BAT1/status)
+ if [[ "$status" = "Discharging" ]]; then
+ battery=$(cat /sys/class/power_supply/BAT1/capacity)
+ if [[ battery -lt 16 ]]; then
+ notify-send -u critical "CHARGE" "Very Low Battery" -t 2000
+ elif [[ battery -lt 31 ]]; then
+ notify-send -u normal "CHARGE" "Low Battery" -t 2000
+ fi
+ fi
+ pid=$!
+ sleep 2
+ kill $pid
+done