summaryrefslogtreecommitdiffstats
path: root/.scripts/i3wifi
diff options
context:
space:
mode:
authorAlexander Von Moll <avonmoll@gmail.com>2018-10-06 22:51:59 -0400
committerAlexander Von Moll <avonmoll@gmail.com>2018-10-06 22:51:59 -0400
commit19e515da29f8e303abcb7a17c27b74c9ecfa0fad (patch)
tree72b95a2e9f08ffdac74710bafa5572f8a0f2d6b0 /.scripts/i3wifi
parentf73b483d9d7c955ddbc40f82d3e4a3f6708d7a3b (diff)
downloadeibhear-19e515da29f8e303abcb7a17c27b74c9ecfa0fad.tar.gz
eibhear-19e515da29f8e303abcb7a17c27b74c9ecfa0fad.tar.zst
eibhear-19e515da29f8e303abcb7a17c27b74c9ecfa0fad.zip
Fixed wifi blocklet coloring
Diffstat (limited to '.scripts/i3wifi')
-rwxr-xr-x.scripts/i3wifi14
1 files 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