update batt script

This commit is contained in:
Linux User 2022-09-28 01:48:53 +00:00
parent dde08d8de1
commit 45e85d932a
1 changed files with 10 additions and 0 deletions

View File

@ -23,6 +23,16 @@ else
icon=""
fi
chrg=$(cat /sys/class/power_supply/$DEVICE/status)
if [[ "$chrg" == "Charging" ]]
then
icon=""
elif [[ "$chrg" == "Full" ]]
then
icon=""
fi
batpercent="$(echo $batpercent)%"
echo "^b$COLOR1^^c$COLOR2^ $icon ^c$COLOR1^^b$COLOR2^ $batpercent ^d^"