qtile was an adventure, but dwm is still my favorite.

This commit is contained in:
Bartek Stalewski 2022-08-21 16:40:05 +02:00
parent e06858b8af
commit 27aadd0ed1
32 changed files with 0 additions and 0 deletions

View file

@ -1,18 +0,0 @@
#!/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

View file

@ -1,4 +0,0 @@
#!/bin/bash
icon='\ue20f '
[ $(pgrep -x emerge) ] && printf "$icon <span foreground='#ffffff'background='#9a37ff'>emerge</span>" || printf ""

View file

@ -1,10 +0,0 @@
#!/bin/bash
icon='\uf1eb '
case "$(cat /sys/class/net/w*/operstate 2>/dev/null)" in
down) printf "$icon <span background='#770000'>no wifi</span>" ;;
up)
[ -n "$(ip address show dev wlan0 | grep 'inet ')" ] \
&& printf "$icon $(iw dev wlan0 info | grep 'ssid ' | cut -d' ' -f2-)" \
|| printf "$icon <span background='#770000'>no ip</span>"
esac

View file

@ -1,5 +0,0 @@
#!/bin/bash
icon='\uf028 '
vol=$(pactl get-sink-volume @DEFAULT_SINK@ | awk -F' / ' '{print $2}' | tr -d '%')
[ $(pactl get-sink-mute @DEFAULT_SINK@ | awk -F': ' '{print $2}') = yes ] || [ "$vol" -eq 0 ] && printf "$icon <span foreground='#ffffff' background='#770000'>mute</span>" || printf "$icon ${vol}%%"