]>
Commit | Line | Data |
---|---|---|
1 | #!/bin/sh | |
2 | base=~/.icons/Paper/24x24/panel/network | |
3 | excellent=$base-wireless-signal-excellent.svg | |
4 | good=$base-wireless-signal-good.svg | |
5 | ok=$base-wireless-signal-ok.svg | |
6 | low=$base-wireless-signal-low.svg | |
7 | none=$base-wireless-signal-none.svg | |
8 | offline=$base-wireless-offline.svg | |
9 | while true; do | |
10 | sleep 3 | |
11 | x=$(ifconfig wlan0 list sta) | |
12 | if [ $? != 0 ]; then | |
13 | echo $offline | |
14 | continue | |
15 | fi | |
16 | x=$(echo "$x" | awk 'NR == 1 {next} {printf "%.0f", $5}') | |
17 | if [ $x -ge 20 ]; then | |
18 | echo $excellent | |
19 | elif [ $x -ge 15 ]; then | |
20 | echo $good | |
21 | elif [ $x -ge 10 ]; then | |
22 | echo $ok | |
23 | elif [ $x -ge 5 ]; then | |
24 | echo $low | |
25 | else | |
26 | echo $none | |
27 | fi | |
28 | done |