diff --git a/scripts/battery_on_lock.sh b/scripts/battery_on_lock.sh index 907e0e1..136c02f 100755 --- a/scripts/battery_on_lock.sh +++ b/scripts/battery_on_lock.sh @@ -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)