qtile gives me more than dwm. I will try to live with it's quirks.

This commit is contained in:
Bartek Stalewski 2022-08-23 00:15:20 +02:00
parent 35ccb08948
commit 75517d5ad3
35 changed files with 9 additions and 9 deletions

18
_desktop/_scripts/sb-battery Executable file
View file

@ -0,0 +1,18 @@
#!/bin/bash
icon='\uf241 '
for battery in /sys/class/power_supply/BAT?*; do
# If non-first battery, print a space separator.
[ -n "${capacity+x}" ] && printf " "
# Sets up the status and capacity
case "$(cat "$battery/status")" in
"Full") status="\uf102" ;;
"Discharging") status="\uf078" ;;
"Charging") status="\uf077" ;;
"Not charging") status="\uf444" ;;
"Unknown") status="\uf128" ;;
esac
capacity=$(cat "$battery/capacity")
# Will make a warn variable if discharging and low
[ "$capacity" -le 20 ] && printf "$icon <span foreground='#ffffff' background='#770000'>${status} ${capacity}%%</span>" || printf "$icon ${status} ${capacity}%%"
done && exit 0