Cleanup the battery function
This commit is contained in:
parent
e3dc2b9a38
commit
6dc4277b4f
1 changed files with 7 additions and 9 deletions
16
neofetch
16
neofetch
|
@ -1408,18 +1408,16 @@ getbattery () {
|
||||||
battery="${battery}%"
|
battery="${battery}%"
|
||||||
|
|
||||||
else
|
else
|
||||||
# If there's only a single battery and it's battery 0,
|
if [ "${#batteries[@]}" -gt 1 ]; then
|
||||||
# don't number the subtitle.
|
# Print each battery on a separate line.
|
||||||
if [ "${#batteries[@]}" == 1 ]; then
|
for bat in "${batteries[@]}"; do
|
||||||
battery="${batteries[0]}%"
|
prin "${title}${index}: ${bat}%"
|
||||||
|
index=$((index + 1))
|
||||||
|
done
|
||||||
return
|
return
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Print each battery on a separate line.
|
battery="${batteries[0]}%"
|
||||||
for bat in "${batteries[@]}"; do
|
|
||||||
prin "${title}${index}: ${bat}%"
|
|
||||||
index=$((index + 1))
|
|
||||||
done
|
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
battery="None"
|
battery="None"
|
||||||
|
|
Loading…
Reference in a new issue