From 19e515da29f8e303abcb7a17c27b74c9ecfa0fad Mon Sep 17 00:00:00 2001 From: Alexander Von Moll Date: Sat, 6 Oct 2018 22:51:59 -0400 Subject: [PATCH] Fixed wifi blocklet coloring --- .scripts/i3wifi | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/.scripts/i3wifi b/.scripts/i3wifi index 3fe5fb0..b9f79ec 100755 --- a/.scripts/i3wifi +++ b/.scripts/i3wifi @@ -8,18 +8,18 @@ INTERFACE="${BLOCK_INSTANCE:-wlan0}" [[ "$(cat /sys/class/net/$INTERFACE/operstate)" = 'down' ]] && echo 📡 && exit -QUALITY=$(grep $INTERFACE /proc/net/wireless | awk '{ print int($3 * 100 / 70) }') +QUALITY=$(grep $INTERFACE /proc/net/wireless | awk '{ print int($3 * 100 / 70 - 1) }') echo 📶 $QUALITY% echo 📶 $QUALITY% # color if [[ $QUALITY -ge 80 ]]; then - echo "#00FF00" -elif [[ $QUALITY -lt 80 ]]; then - echo "#FFF600" -elif [[ $QUALITY -lt 60 ]]; then - echo "#FFAE00" + echo "#00FF00" elif [[ $QUALITY -lt 40 ]]; then - echo "#FF0000" + echo "#FF0000" +elif [[ $QUALITY -lt 60 ]]; then + echo "#FF8000" +elif [[ $QUALITY -lt 80 ]]; then + echo "#FFF600" fi