14 lines
485 B
Bash
Executable file
14 lines
485 B
Bash
Executable file
#!/bin/sh
|
|
iface=$(ip link | awk '/state UP/ && !/lo/ {print $2}' | tr -d ':' | grep -v eth | head -1)
|
|
ssid=$(iwgetid "$iface" -r 2>/dev/null)
|
|
strength=$(awk "/$iface/ {print int(\$3 * 100 / 70)}" /proc/net/wireless 2>/dev/null)
|
|
if [ -z "$ssid" ]; then
|
|
echo " disconnected"
|
|
else
|
|
if [ "$strength" -ge 75 ]; then icon=""
|
|
elif [ "$strength" -ge 50 ]; then icon=""
|
|
elif [ "$strength" -ge 25 ]; then icon=""
|
|
else icon=""
|
|
fi
|
|
echo "$icon $ssid $strength%"
|
|
fi
|