fix: exit hypridle battery script when BAT1 doesn't exist

This commit is contained in:
wyj
2026-06-30 21:53:26 -04:00
parent 320ad9df0f
commit c0201ea4e7
+4
View File
@@ -1,5 +1,9 @@
#!/bin/bash
if [[ ! -d /sys/class/power_supply/BAT1 ]]; then
exit 0
fi
# Get the current battery percentage
battery_percentage=$(cat /sys/class/power_supply/BAT1/capacity)