add batt script
This commit is contained in:
parent
ec5e14d81a
commit
dde08d8de1
|
@ -0,0 +1,28 @@
|
|||
#!/bin/bash
|
||||
|
||||
DEVICE=BAT1
|
||||
COLOR1="#FF00F4"
|
||||
COLOR2="#83007D"
|
||||
|
||||
|
||||
batpercent="$(cat /sys/class/power_supply/$DEVICE/capacity)"
|
||||
|
||||
if [[ $((batpercent + 0)) -ge 80 ]]
|
||||
then
|
||||
icon=""
|
||||
elif [[ $((batpercent + 0)) -ge 60 ]]
|
||||
then
|
||||
icon=""
|
||||
elif [[ $((batpercent + 0)) -ge 40 ]]
|
||||
then
|
||||
icon=""
|
||||
elif [[ $((batpercent + 0)) -ge 20 ]]
|
||||
then
|
||||
icon=""
|
||||
else
|
||||
icon=""
|
||||
fi
|
||||
|
||||
batpercent="$(echo $batpercent)%"
|
||||
|
||||
echo "^b$COLOR1^^c$COLOR2^ $icon ^c$COLOR1^^b$COLOR2^ $batpercent ^d^"
|
Loading…
Reference in New Issue