Prevent get_battery from throwing "file not found"

This commit is contained in:
Bruno Bronosky 2022-06-12 22:20:12 -05:00
parent ccd5d9f526
commit bcc504190a

View file

@ -3765,6 +3765,7 @@ get_battery() {
# We use 'prin' here so that we can do multi battery support
# with a single battery per line.
for bat in "/sys/class/power_supply/"{BAT,axp288_fuel_gauge,CMB}*; do
[[ -f ${bat}/capacity && -f ${bat}/status ]] || continue
capacity="$(< "${bat}/capacity")"
status="$(< "${bat}/status")"