feat: better handle 2 batteries
This commit is contained in:
parent
0aa8c15431
commit
bf8804a467
@ -37,10 +37,12 @@ do
|
|||||||
status="$(cat "$bat/status")"
|
status="$(cat "$bat/status")"
|
||||||
capacity="$(cat "$bat/capacity")"
|
capacity="$(cat "$bat/capacity")"
|
||||||
total="$(expr $total + $capacity)"
|
total="$(expr $total + $capacity)"
|
||||||
|
slot="$(basename $bat)"
|
||||||
if [ "$status" = "Full" ]; then
|
if [ "$status" = "Full" ]; then
|
||||||
status=" " && capacity="FULL"
|
status=" " && capacity="FULL"
|
||||||
printf " %s %s " "$status" "$capacity" && exit
|
printf " %s:%s(%s) " "$slot" "$status" "$capacity"
|
||||||
elif [ "$status" = "Charging" ]; then
|
else
|
||||||
|
if [ "$status" = "Charging" ]; then
|
||||||
status=""
|
status=""
|
||||||
else
|
else
|
||||||
case "$capacity" in
|
case "$capacity" in
|
||||||
@ -52,5 +54,6 @@ do
|
|||||||
esac
|
esac
|
||||||
fi
|
fi
|
||||||
[ 40 -gt $total ] && notify;
|
[ 40 -gt $total ] && notify;
|
||||||
printf " %s %3d%% " "$status" "$capacity";
|
printf " %s:%s (%0.2d%%) " "$slot" "$status" "$capacity";
|
||||||
|
fi
|
||||||
done
|
done
|
||||||
|
Reference in New Issue
Block a user