aboutsummaryrefslogtreecommitdiff
path: root/ratpoison/panel/signal
blob: 75ec2533d61778015e43a3c38eedb5f0d101f57b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#!/bin/sh
while true;do
signal=`iwconfig wlp2s0 | grep Signal| perl -pe 's/.*level=//; s/ dBm.*//'`
#convert to Quality

    if [ $signal -le -100 ];then
        quality=0;
    elif [ $signal -ge -50 ];then
        quality=100;
    elif [ -z $signal  ];then
    quality=0;
    else
        quality=$(( 2 * ( $signal + 100 )));
    fi

echo "S$quality";
sleep 3;
done