This commit is contained in:
2025-09-18 11:35:56 +02:00
commit 2203d6075f
45 changed files with 935 additions and 0 deletions

13
shell/battery_shutdown.sh Executable file
View File

@@ -0,0 +1,13 @@
#!/bin/sh
# Get battery percentage from /sys/class/power_supply/BAT0/capacity
BATTERY=$(cat /sys/class/power_supply/BAT0/capacity)
STATUS=$(cat /sys/class/power_supply/BAT0/status)
echo $BATTERY
echo $STATUS
# Only shutdown if on battery (discharging) and low
if [ "$STATUS" = "Discharging" ] && [ "$BATTERY" -lt 15 ]; then
systemctl poweroff
fi