dotfiles/_suckless/_scripts/sb-network

10 lines
314 B
Plaintext
Raw Normal View History

2021-07-26 16:52:58 +02:00
#!/bin/bash
2021-06-19 15:50:04 +02:00
case "$(cat /sys/class/net/w*/operstate 2>/dev/null)" in
2022-04-15 20:17:46 +02:00
down) printf "^c#ffffff^^b#770000^no wifi^d^" ;;
2021-08-26 23:13:53 +02:00
up)
[ -n "$(ip address show dev wlan0 | grep 'inet ')" ] \
2022-04-14 15:33:56 +02:00
&& printf "$(iw dev wlan0 info | grep 'ssid ' | cut -d' ' -f2-)" \
|| printf "^c#ffffff^^b#770000^no ip^d^" ;;
2021-06-19 15:50:04 +02:00
esac