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