Fixed battery level showing more than 100%

This commit is contained in:
G2-Games 2022-09-17 23:57:13 -05:00
parent 9575f5e9e1
commit 13a72920d5

View file

@ -60,6 +60,10 @@ battery () {
batlvl=$(cat /sys/class/power_supply/BAT1/capacity)
fi
if [ $batlvl -ge 100 ]; then
batlvl=100
fi
# Change color depending on level
if [ $batlvl -eq 100 ]; then
echo -en "The battery is ${FULL}fully charged${NCOL}. "