dotfiles/_desktop/_scripts/sb-network

11 lines
327 B
Bash
Executable File

#!/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 $(iwgetid -r)" \
|| printf "$icon <span background='#770000'>no ip</span>"
esac