aboutsummaryrefslogtreecommitdiff
path: root/Panel/lemonbar/signal
blob: 40ac9082e40cda936d9530ed6163b3bf4c8d58d9 (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 $INTERFACE | 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