From c2f0fa4e6a50a13a0264e1f87959aece465ab389 Mon Sep 17 00:00:00 2001 From: David JULIEN Date: Sun, 19 Sep 2021 12:30:30 +0200 Subject: [PATCH] feat: do not compute wifi strength only display ssid tweak wifi tests --- .local/bin/statusbar/sb-internet | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.local/bin/statusbar/sb-internet b/.local/bin/statusbar/sb-internet index 0b47f56..def21ed 100755 --- a/.local/bin/statusbar/sb-internet +++ b/.local/bin/statusbar/sb-internet @@ -11,9 +11,10 @@ # Wifi quality percentage and  icon if ethernet is connected. -wifi="$(grep "^\s*w" /proc/net/wireless | awk '{ printf int($3 * 100 / 70) }')" -[ $wifi -ne 0 ] && str="$(printf "直 %3d%%" $wifi)" || str="$(printf "睊")" -eth="$(cat /sys/class/net/eno1/operstate)" +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 " ---")" +eth="$(cat /sys/class/net/enp0s31f6/operstate)" if [ "up" = "$eth" ]; then str="$(printf "%s /  " "$str")" fi