Migrate from qtile bar to eww widgets

This commit is contained in:
2022-03-25 19:10:57 +03:00
parent c2c1a13ed3
commit 375bf79693
23 changed files with 1451 additions and 188 deletions

43
.config/eww/bar/scripts/battery Executable file
View File

@ -0,0 +1,43 @@
#!/bin/sh
bat=/sys/class/power_supply/BAT0/
per="$(cat "$bat/capacity")"
icon() {
[ $(cat "$bat/status") = Charging ] && echo "" && exit
if [ "$per" -gt "90" ]; then
icon=""
elif [ "$per" -gt "80" ]; then
icon=""
elif [ "$per" -gt "70" ]; then
icon=""
elif [ "$per" -gt "60" ]; then
icon=""
elif [ "$per" -gt "50" ]; then
icon=""
elif [ "$per" -gt "40" ]; then
icon=""
elif [ "$per" -gt "30" ]; then
icon=""
elif [ "$per" -gt "20" ]; then
icon=""
elif [ "$per" -gt "10" ]; then
icon=""
elif [ "$per" -gt "0" ]; then
icon=""
else
echo  && exit
fi
echo "$icon"
}
percent() {
echo $per
}
[ "$1" = "icon" ] && icon && exit
[ "$1" = "percent" ] && percent && exit
exit