fix: exit hypridle battery script when BAT1 doesn't exist
This commit is contained in:
@@ -1,5 +1,9 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
|
if [[ ! -d /sys/class/power_supply/BAT1 ]]; then
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
|
||||||
# Get the current battery percentage
|
# Get the current battery percentage
|
||||||
battery_percentage=$(cat /sys/class/power_supply/BAT1/capacity)
|
battery_percentage=$(cat /sys/class/power_supply/BAT1/capacity)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user