dotfiles/_desktop/_scripts/sb-network

11 lines
366 B
Plaintext
Raw Normal View History

2022-07-30 01:02:25 +02:00
#!/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