update scripts

This commit is contained in:
2023-03-02 14:37:56 +05:00
parent dd5cfd84fa
commit db2199c05b
6 changed files with 62 additions and 35 deletions

View File

@ -1,40 +1,41 @@
#!/bin/bash
DEVICE="BAT1"
DEVICE="BAT0"
COLOR1="#FF00F4"
COLOR2="#83007D"
if [ ! -f "$FILE" ]
if [ ! -f "/sys/class/power_supply/$DEVICE/capacity" ]
then
DEVICE="$(ls /sys/class/power_supply/ -1 -t | head -1)"
echo "0185"
exit 1
fi
batpercent="$(cat /sys/class/power_supply/$DEVICE/capacity)"
if [[ $((batpercent + 0)) -ge 80 ]]
if [ $batpercent -ge 80 ]
then
icon=""
elif [[ $((batpercent + 0)) -ge 60 ]]
elif [ $batpercent -ge 60 ]
then
icon=""
elif [[ $((batpercent + 0)) -ge 40 ]]
elif [ $batpercent -ge 40 ]
then
icon=""
elif [[ $((batpercent + 0)) -ge 20 ]]
elif [ $batpercent -ge 20 ]
then
icon=""
else
icon=""
fi
chrg=$(cat /sys/class/power_supply/$DEVICE/status)
chrg="$(cat /sys/class/power_supply/$DEVICE/status)"
if [[ "$chrg" == "Charging" ]]
if [ "$chrg" = "Charging" ]
then
icon=""
elif [[ "$chrg" == "Full" ]]
elif [ "$chrg" = "Full" ]
then
icon=""
fi