[statusbar] feat: handle >100% battery cases

This commit is contained in:
David JULIEN 2022-06-11 12:24:01 +02:00
parent 1bd3ea5adc
commit 72d94850b4

View File

@ -41,6 +41,9 @@ do
if [ "Full" = "$status" ]; then if [ "Full" = "$status" ]; then
status=" " && capacity="FULL" status=" " && capacity="FULL"
printf " %s:%s(%s) " "$slot" "$status" "$capacity" printf " %s:%s(%s) " "$slot" "$status" "$capacity"
else
if [ 100 -lt $(expr $capacity) ]; then
status=""
else else
if [ "$status" = "Charging" ]; then if [ "$status" = "Charging" ]; then
status="" status=""
@ -56,4 +59,5 @@ do
fi fi
printf " %s:%s (%0.2d%%) " "$slot" "$status" "$capacity"; printf " %s:%s (%0.2d%%) " "$slot" "$status" "$capacity";
fi fi
fi
done done