summaryrefslogtreecommitdiff
path: root/.config/wmii-hg/rbar_wifi
diff options
context:
space:
mode:
authorLuke Shumaker <lukeshu@sbcglobal.net>2015-01-06 13:18:31 -0500
committerLuke Shumaker <lukeshu@sbcglobal.net>2015-01-06 13:18:31 -0500
commit87428a01acb77a94d35c03264d376a2ee3853664 (patch)
tree2e5483f200e321545138b99e45b023c754ece4d6 /.config/wmii-hg/rbar_wifi
parentd7128cd444fce3129a78e08fe643978fb25c3846 (diff)
wmii: re-jigger the rbar
Diffstat (limited to '.config/wmii-hg/rbar_wifi')
-rwxr-xr-x.config/wmii-hg/rbar_wifi17
1 files changed, 15 insertions, 2 deletions
diff --git a/.config/wmii-hg/rbar_wifi b/.config/wmii-hg/rbar_wifi
index 18395a3..53464dc 100755
--- a/.config/wmii-hg/rbar_wifi
+++ b/.config/wmii-hg/rbar_wifi
@@ -1,9 +1,22 @@
#!/bin/bash
. include.sh
-priority=$1
+id=$1
+trap "rm -f ${WMII_DIR}/rbar/${id}" EXIT
+
+iwinfo() {
+ interface=$1
+ iwconfig "$interface" |
+ sed -r 's/ {2,}/\n/g' |
+ sed -e '/^\s*$/d' -e 's/:\s*/=/' \
+ -e '1s/^/Interface=/' \
+ -e '2s/^/MAC Protocol=/'
+}
while connected_to_x_server; do
- echo 'label Wlan0:' $(iwconfig wlan0 | sed 's/ /\n/g' | grep Quality) >> "$WMII_DIR/rbar/${priority}_wifi"
+ {
+ printf 'label '
+ iwinfo wlp2s0|grep -E '^(ESSID|Link Quality)='|sed 'N;s/\n/ | /'
+ } | sponge >> "${WMII_DIR}/rbar/${id}"
sleep 1
done