From c542356802b701b8fd2978b5367a51363bf18145 Mon Sep 17 00:00:00 2001 From: Riyyi Date: Sun, 8 Apr 2018 13:45:13 +0200 Subject: [PATCH] Display info on click in wifi block --- .scripts/wm/wifi.sh | 23 ++++++++++++++++++----- 1 file changed, 18 insertions(+), 5 deletions(-) diff --git a/.scripts/wm/wifi.sh b/.scripts/wm/wifi.sh index 45225a2..d6b6e8b 100755 --- a/.scripts/wm/wifi.sh +++ b/.scripts/wm/wifi.sh @@ -8,10 +8,23 @@ if [ ! -d /sys/class/net/${WIRELESS}/wireless ] || echo "" echo "#676E7D" else - SSID=$(iw dev $WIRELESS link | awk '/SSID/ { print $2 }') - QUALITY=$(grep $WIRELESS /proc/net/wireless | awk '{ print int($3 * 100 / 70) }') - - echo "$SSID  $QUALITY%" - echo "$ $QUALITY%" + SSID="$(iw dev $WIRELESS link | awk '/SSID/ { print $2 }')" + QUALITY=$(grep $WIRELESS /proc/net/wireless | \ + awk '{ print int($3 * 100 / 70) }') + + echo " $QUALITY%" + echo " $QUALITY%" echo "#FFFFFF" fi + +notify() { + notify-send -r 3 "Wifi" "\ +Interface: $WIRELESS +SSID: $SSID +IP: $(ip a show $WIRELESS | \ + awk '/inet / { print substr($2, 0, length($2) - 3) }')" +} + +case $BLOCK_BUTTON in + 1) notify ;; +esac