[statusbar] feat: separate states for wifi down and no ssid

This commit is contained in:
David JULIEN 2022-07-28 20:06:53 +02:00
parent 4540ec5578
commit 40a6eb6330
1 changed files with 5 additions and 1 deletions

View File

@ -13,7 +13,11 @@
# Wifi quality percentage and  icon if ethernet is connected.
ssid="$(wpa_cli status | grep -i ^ssid | sed -e 's/.*=//')"
state="$(wpa_cli status | grep -i ^wpa_state | sed -e 's/.*=//')"
[ "COMPLETED" = $state ] && str="$(printf " %s" $ssid)" || str="$(printf " ---")"
case "$state" in
COMPLETED) str="$(printf " %s" $ssid)" ;;
INTERFACE_DISABLED) str="WIFI DOWN" ;;
*) str="$(printf "NO WIFI")";;
esac
eth="$(cat /sys/class/net/enp0s31f6/operstate)"
if [ "up" = "$eth" ]; then
str="$(printf "%s /  " "$str")"