helm/os/arch/.config/panel/lemons/wifi.sh

28 lines
547 B
Bash
Raw Normal View History

2016-10-19 07:56:37 -07:00
#!/usr/bin/env bash
2016-10-31 19:07:23 -07:00
wifioff="\ue21a"
wifi0="\ue25d"
wifi1="\ue25e"
wifi2="\ue25f"
wifi3="\ue260"
wifi4="\ue261"
2016-10-19 07:56:37 -07:00
while :
do
2016-10-31 19:07:23 -07:00
signal=$(awk 'NR==3 {print $3}' /proc/net/wireless)
if [ -n "$signal" ]
then
icon=$wifi0
case "$signal" in
100|[6-9][0-9]*) icon=$wifi4 ;;
[4-5][0-9]*) icon=$wifi3 ;;
[2-3][0-9]*) icon=$wifi2 ;;
*) icon=$wifi1 ;;
esac
echo "I$icon $(iwgetid -r)"
else
echo "I%{F$COLOR_FREE_FG}${wifioff}%{F-} "
fi
2016-10-19 07:56:37 -07:00
sleep 5
2016-10-31 19:07:23 -07:00
done