Keep it short.

This commit is contained in:
Bartek Stalewski 2022-04-14 10:33:51 +02:00
parent c5a5df67a0
commit 51233cea8d
4 changed files with 16 additions and 17 deletions

View file

@ -1,9 +1,8 @@
#!/bin/bash
case "$(cat /sys/class/net/w*/operstate 2>/dev/null)" in
down) printf "^c#ffffff^^b#770000^no wifi^d^" ;;
down) printf " ^c#ffffff^^b#770000^ no wifi^d^" ;;
up)
[ -n "$(ip address show dev wlan0 | grep 'inet ')" ] \
&& printf "$(iw dev wlan0 info | grep 'ssid ' | cut -d' ' -f2-)" \
|| printf "^c#ffffff^^b#770000^no ip^d^" ;;
&& printf "" || printf " ^c#ffffff^^b#770000^no ip^d^" ;;
esac