repositories / dotfiles

dotfiles

bugabingas dorkfiles

owned by bugabinga

ironbar/scripts/wifi-status.sh

Raw
#!/bin/sh

station=${1:-wlan0}
raw=$(iwctl station "$station" show 2>/dev/null | sed 's/\x1b\[[0-9;]*m//g')
state=$(printf '%s\n' "$raw" | awk '/State/ {print $2; exit}')

if [ "$state" != connected ]; then
	printf '󰖪 off\n'
	exit 0
fi

printf '󰖩\n'