summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuke Shumaker <lukeshu@datawire.io>2019-04-29 15:52:49 -0400
committerLuke Shumaker <lukeshu@datawire.io>2019-04-29 15:52:49 -0400
commit90cacb963dd75fec6d6f7e470fbd4f386d998e95 (patch)
treed45591a12470e8176fb66bd78cdb139ba6364d59
parent74fabe738b1d4330fe60d52195f03af4ce15775d (diff)
wmii: wifi: More info
-rwxr-xr-x.config/wmii-hg/rbar_wifi33
1 files changed, 23 insertions, 10 deletions
diff --git a/.config/wmii-hg/rbar_wifi b/.config/wmii-hg/rbar_wifi
index e740777..14beba2 100755
--- a/.config/wmii-hg/rbar_wifi
+++ b/.config/wmii-hg/rbar_wifi
@@ -1,19 +1,32 @@
#!/usr/bin/env bash
update() {
- local iface=wlp2s0
-
local id
id=$1
- setup_trap "$id"
+ setup_trap "${id}.*"
+
while true; do
- IFS=$'\n'
- lines=($(
- iwdata "$iface" | sed -rn 's@^(ESSID|Link Quality)=@@p'
- ifdata -pa "$iface"
- ))
- IFS='|'
- echo "label ${lines[*]}" | write "$id"
+ for iface in /sys/class/net/*; do
+ iface=${iface##*/}
+ parts=()
+ case "$iface" in
+ lo|docker0)
+ continue
+ ;;
+ w*)
+ IFS=$'\n'
+ parts+=($(iwdata "$iface" | sed -rn 's@^(ESSID|Link Quality)=@@p'))
+ ;;
+ *)
+ :
+ ;;
+ esac
+ parts+=("$(ifdata -pa "$iface")")
+ IFS='|'
+ printf '%s\n' "${iface}:${parts[*]}"
+ done | cat -n | while read -r n line; do
+ printf "label %s\n" "$line" | write "${id}.${n}"
+ done
sleep 1
done
}