aboutsummaryrefslogtreecommitdiff
path: root/Window_Manager/ratpoison/panel/signal
blob: d494f5de5686a55cd98304bd90b482f4d9ac96b9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#!/bin/bash
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