diff --git a/_desktop/_scripts/sb-network b/_desktop/_scripts/sb-network new file mode 100755 index 0000000..22a32e8 --- /dev/null +++ b/_desktop/_scripts/sb-network @@ -0,0 +1,8 @@ +#!/bin/bash + +case "$(cat /sys/class/net/w*/operstate 2>/dev/null)" in + down) printf "no wifi" ;; + up) + [ -n "$(ip address show dev wlan0 | grep 'inet ')" ] || printf "no ip" +# && printf "$icon $(iwgetid -r)" \ +esac diff --git a/_desktop/qtile/config.py b/_desktop/qtile/config.py index c97d905..52ad7a1 100644 --- a/_desktop/qtile/config.py +++ b/_desktop/qtile/config.py @@ -154,9 +154,11 @@ screens = [ update_interval=1, cmd="sb-volume", ), - widget.Wlan( - format='', - disconnected_message="no wifi", + widget.GenPollCommand( + background='#770000', + foreground='#ffffff', + update_interval=1, + cmd="sb-network", ), widget.Battery( format='{char} {percent:2.0%}',