From fe593a480e000895e953d4f26f5a7631b411e5cd Mon Sep 17 00:00:00 2001 From: Xaver Hellauer Date: Thu, 18 Jul 2019 12:15:33 +0200 Subject: [PATCH 1/2] BSSID string in wifiiw_linux module --- widgets/wifiiw_linux.lua | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/widgets/wifiiw_linux.lua b/widgets/wifiiw_linux.lua index 82d4e3f..47aa5ee 100644 --- a/widgets/wifiiw_linux.lua +++ b/widgets/wifiiw_linux.lua @@ -41,7 +41,9 @@ local function worker(format, warg) if iwresult == nil or string.find(iwresult, "No such device") then return winfo end - -- string match is simple in most cases, because iw uses a new line for every info + -- string match is simple in most cases, because iw uses a new line for every info + winfo["{bssid}"] = -- BSSID has hex digits and colons + string.match(iwresult, "Connected to ([%x:]*)") or "N/A" winfo["{ssid}"] = -- SSID can have almost anything in it until new line string.match(iwresult, "SSID: ([^\n]*)") or "N/A" winfo["{mode}"] = -- everything after 'type ' until new line From a2467bead4846d3659920b77295f60d5e48eb1dd Mon Sep 17 00:00:00 2001 From: Xaver Hellauer Date: Thu, 18 Jul 2019 20:36:12 +0200 Subject: [PATCH 2/2] documentation of ${bssid} in vicious.widgets.wifiiw --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 27fbce5..4aaba6d 100644 --- a/README.md +++ b/README.md @@ -525,7 +525,7 @@ vicious.widgets.wifi, but uses `iw` instead of `iwconfig`). Supported platforms: GNU/Linux. * Argument: the network interface, e.g. `"wlan0"` -* Returns a table with string keys: `${ssid}`, `${mode}`, `${chan}`, `${rate}`, +* Returns a table with string keys: `${bssid}`, `${ssid}`, `${mode}`, `${chan}`, `${rate}`, `${freq}`, `${linp}` (link quality in percent), `${txpw}` (tx power) and `${sign}` (signal level)