From bcc504190a4856327c3e80e4ade7205e981aff31 Mon Sep 17 00:00:00 2001 From: Bruno Bronosky Date: Sun, 12 Jun 2022 22:20:12 -0500 Subject: [PATCH] Prevent get_battery from throwing "file not found" --- neofetch | 1 + 1 file changed, 1 insertion(+) diff --git a/neofetch b/neofetch index 48b96d21..a403152c 100755 --- a/neofetch +++ b/neofetch @@ -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")"