summaryrefslogtreecommitdiff
path: root/.local/bin/notify-battery
diff options
context:
space:
mode:
authorfrosty <passedgoandgot200@disroot.org>2025-07-04 07:07:06 -0400
committerfrosty <passedgoandgot200@disroot.org>2025-07-04 07:07:06 -0400
commit0a70b07e4bb0d22d8762697ff863cf87179f9731 (patch)
treea08e4d448d867f4e904314798e0f9d3f89fe48d2 /.local/bin/notify-battery
parent9be23514542ab9aedb6fb465301cba7a134fd4eb (diff)
downloaddotfiles-0a70b07e4bb0d22d8762697ff863cf87179f9731.tar.gz
dotfiles-0a70b07e4bb0d22d8762697ff863cf87179f9731.zip
add scripts
Diffstat (limited to '.local/bin/notify-battery')
-rwxr-xr-x.local/bin/notify-battery8
1 files changed, 8 insertions, 0 deletions
diff --git a/.local/bin/notify-battery b/.local/bin/notify-battery
new file mode 100755
index 0000000..f50e356
--- /dev/null
+++ b/.local/bin/notify-battery
@@ -0,0 +1,8 @@
+#!/bin/sh
+
+set -eu
+
+for bat in /sys/class/power_supply/BAT*; do
+ read -r capacity <"$bat"/capacity
+ notify-send -c osd -h int:value:"$capacity" -h string:x-dunst-stack-tag:"$0_$bat" "Battery (${bat##*/})" "$capacity%"
+done