]> git.sev.monster Git - dotfiles.git/blobdiff - bin/tint2-wifi
zprofile: remove unnecessary variable
[dotfiles.git] / bin / tint2-wifi
index b59f04a080b7cc33bd2abc659c0199c1f29cf73c..89df22761ed72fb58384f66d0228a2abe4feebef 100755 (executable)
@@ -1,28 +1,30 @@
 #!/bin/sh
-base=~/.icons/Paper/24x24/panel/network
-excellent=$base-wireless-signal-excellent.svg
-     good=$base-wireless-signal-good.svg
-       ok=$base-wireless-signal-ok.svg
-      low=$base-wireless-signal-low.svg
-     none=$base-wireless-signal-none.svg
-  offline=$base-wireless-offline.svg
+base=~/.icons/Paper-Mono-Dark/24x24/panel/network-wireless
+excellent=$base-signal-excellent.svg
+     good=$base-signal-good.svg
+       ok=$base-signal-ok.svg
+      low=$base-signal-low.svg
+     none=$base-signal-none.svg
+ no_route=$base-no-route.svg
+  offline=$base-offline.svg
+
+echo $base-acquiring.svg
 while true; do
-       sleep 3
-       x=$(ifconfig wlan0 list sta)
-       if [ $? != 0 ]; then
+       x=$(cat /proc/net/wireless | awk 'NR < 3 {next} {printf "%.0f", $4}')
+       if [ -z $x ]; then
                echo $offline
-               continue
-       fi
-       x=$(echo "$x" | awk 'NR == 1 {next} {printf "%.0f", $5}')
-       if [ $x -ge 20 ]; then
+       elif [ $x -ge -55 ]; then
                echo $excellent
-       elif [ $x -ge 15 ]; then
+       elif [ $x -ge -65 ]; then
                echo $good
-       elif [ $x -ge 10 ]; then
+       elif [ $x -ge -75 ]; then
                echo $ok
-       elif [ $x -ge 5 ]; then
+       elif [ $x -ge -85 ]; then
                echo $low
-       else
+       elif [ $x -ge -90 ]; then
                echo $none
+       else
+               echo $no_route
        fi
+       sleep 2
 done
This page took 0.032832 seconds and 4 git commands to generate.