aboutsummaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
authorBaitinq <30861839+Baitinq@users.noreply.github.com>2021-10-21 13:34:05 +0100
committerGitHub <noreply@github.com>2021-10-21 13:34:05 +0100
commitae937dfd0f47ad76e2e72bc3b934924f5bea2e97 (patch)
tree137d28970fe4c2ac390175bc90033c447cb600c1 /modules
parent0d122c2453ca7889baf165c3879e45c973486b5f (diff)
Update WIFI module so that it doesnt show the icon when not connected to wifi
Diffstat (limited to 'modules')
-rwxr-xr-xmodules/wifi5
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
-