So I have been trying to get this script to work for a few days now. The script is supposed to compare the wireless signal quality to if statements in a function and then echo an image. I just cannot seem to get the image to show up on the desktop when calling the wlanscript.sh from my conky. Can someone please look through the script and tell me if I am doing something wrong? I gave the script sudo chmod +x wlanscript.sh to make it executable, was that right?
From the conky I am calling the script with:
From the conky I am calling the script with:
Code:
${alignc -10}${execpi /home/kris/wlanscript.sh}
Code:
#! /bin/bash
function dload()
{
if [ $lq -le 100 ] && [ $lq -gt 65 ]; then
echo '${image /home/kris/.images/wlan100.png -s 94x79 -p 10,520}'
fi
if [ $lq -le 66 ] && [ $lq -gt 55 ]; then
echo '${image /home/kris/.images/wlan50.png -s 94x79 -p 100,25}'
fi
if [ $lq -le 56 ] && [ $lq -gt 49 ]; then
echo '${image /home/kris/.images/wlan40.png -s 994x979 -p 10,725}'
fi
if [ $lq -le 50 ] && [ $lq -gt 5 ]; then
echo '${image /home/kris/.images/wlan5.png -s 994x979 -p 0,625}'
fi
}
function usage()
{
echo ${image /home/kris/.images/wlan0.png -s 94x79 -p 100,25}
}
lq=$(sudo iwconfig eth1 | sed -n 's/.*Signal level[:=]-\([0-9]*\).*/\1/gp')
"$lq"=lq
if [ $lq -le 5 ]
then
usage
else
dload
fi