summaryrefslogtreecommitdiff
path: root/mybar/wifi.awk
blob: 90d3f9d6a901982e5a6600acb0137bf5a073ebb3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#!/bin/awk -f

BEGIN {
	FS=":"
	essid="-"
	qual="0"
}
$1 == "Essid" {
	split($2, parts, " ")
	sep=""
	essid = ""
	for(i in parts) {
		essid = sep parts[i]
		sep="_"
	}
}
$1 == "Quality" {
	qual = $2
}
END {
	print "wifi " essid " " qual
}