diff options
author | Baitinq <30861839+Baitinq@users.noreply.github.com> | 2021-10-21 13:34:05 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-10-21 13:34:05 +0100 |
commit | ae937dfd0f47ad76e2e72bc3b934924f5bea2e97 (patch) | |
tree | 137d28970fe4c2ac390175bc90033c447cb600c1 /modules/wifi | |
parent | 0d122c2453ca7889baf165c3879e45c973486b5f (diff) |
Update WIFI module so that it doesnt show the icon when not connected to wifi
Diffstat (limited to 'modules/wifi')
-rwxr-xr-x | modules/wifi | 5 |
1 files 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 - |