From ae937dfd0f47ad76e2e72bc3b934924f5bea2e97 Mon Sep 17 00:00:00 2001 From: Baitinq <30861839+Baitinq@users.noreply.github.com> Date: Thu, 21 Oct 2021 13:34:05 +0100 Subject: [PATCH] Update WIFI module so that it doesnt show the icon when not connected to wifi --- modules/wifi | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/modules/wifi b/modules/wifi index fc68fb7..4f56b5a 100755 --- a/modules/wifi +++ b/modules/wifi @@ -5,13 +5,15 @@ WIFI_FULL_ICON='' WIFI_MID_ICON='' WIFI_LOW_ICON='' +NO_WIFI_ICON='' -get_wifi() +get_wifi() { if grep -q wl* "/proc/net/wireless"; then # Wifi quality percentage percentage=$(grep "^\s*w" /proc/net/wireless | awk '{ print "", int($3 * 100 / 70)}'| xargs) case $percentage in + 0) echo $NO_WIFI_ICON;; 100|9[0-9]|8[0-9]|7[0-9]) echo "$WIFI_FULL_ICON" ;; 6[0-9]|5[0-9]|4[0-9]|3[0-9]) echo "$WIFI_MID_ICON" ;; 2[0-9]|1[0-9]|[0-9]) echo "$WIFI_LOW_ICON" ;; @@ -20,4 +22,3 @@ get_wifi() } get_wifi -