Upload scripts

This commit is contained in:
Samuel Webb 2025-01-07 17:57:17 -05:00
parent 6e5095f3cf
commit a54da6dbbe
15 changed files with 70 additions and 37 deletions

View file

@ -1,20 +1,33 @@
#!/bin/sh
level=$(cat /sys/class/power_supply/BAT0/capacity)
level1=$(echo $level | sed s/.$//)
level2="${level: -1}"
stats=$(cat /sys/class/power_supply/BAT0/status)
dicon=(            )
uicon=(            )
icon="󰁹"
dicon=(󰁺 󰁻 󰁼 󰁽 󰁾 󰁿 󰂀 󰂁 )
if [ $stats == "Charging" ]; then
icon=${uicon[$(( level / 10 ))]}
icon="󰂄"
else
icon=${dicon[$(( level / 10 ))]}
case $level1 in
9)
if (( $level2 < 5 )); then
icon="󰂂"
fi;;
"")
if (( $level < 5 )); then
icon="󰂃"
else
icon="󰂎"
fi;;
*)
icon=${dicon[(($level1 - 1))]};;
esac
fi
if [ $level -ge 0 ]; then
color="^c#F75341^"
fi
color="^c#F75341^"
if [ $level -ge 20 ]; then
color="^c#FED06E^"