initial commit

This commit is contained in:
THEON-1
2025-12-04 19:15:16 +01:00
commit 2afc64b5e8
3 changed files with 263 additions and 0 deletions

20
battery-timer.sh Executable file
View File

@@ -0,0 +1,20 @@
#!/usr/bin/env bash
LOW_THRESHOLD=15
CRITICAL_THRESHOLD=5
charge=$(cat /sys/class/power_supply/BAT0/capacity)
state=$(cat /sys/class/power_supply/ACAD/online)
echo "charging: $(state)"
if [[ "$state" == "0" ]]; then
if [[ $charge -le $CRITICAL_THRESHOLD ]]; then
echo "critical"
notify-send -t 10000 -u critical "Battery critically low! ($charge%)"
elif [[ $charge -le $LOW_THRESHOLD ]]; then
echo "low"
notify-send -u normal "Battery low ($charge%)"
fi
fi