[PR] dylanaraps/neofetch#2130 from RichardBronosky - Prevent get_battery from throwing "file not found"
Upstream PR: https://github.com/dylanaraps/neofetch/pull/2130 Thanks to @RichardBronosky Co-authored-by: Bruno Bronosky <Bruno@Bronosky.com>
This commit is contained in:
commit
8ef523174b
1 changed files with 1 additions and 0 deletions
1
neofetch
1
neofetch
|
@ -3808,6 +3808,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")"
|
||||
|
||||
|
|
Loading…
Reference in a new issue