From ca075d0c8e68571ffc3500023eaf81cbf48741a1 Mon Sep 17 00:00:00 2001 From: Xaver Hellauer Date: Thu, 18 Jul 2019 20:34:42 +0200 Subject: [PATCH] BSSID in vicious.widgets.wifiiw --- README.md | 2 +- widgets/wifiiw_linux.lua | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index a6d8e59..fe8b1e2 100644 --- a/README.md +++ b/README.md @@ -538,7 +538,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}`, +* Returns a table with string keys: `${bssid}`, `${ssid}`, `${mode}`, `${chan}`, `${rate}` (Mb/s), `${freq}` (MHz), `${linp}` (link quality in percent), `${txpw}` (transmission power, in dBm) and `${sign}` (signal level, in dBm) diff --git a/widgets/wifiiw_linux.lua b/widgets/wifiiw_linux.lua index 25aebe1..48e97e2 100644 --- a/widgets/wifiiw_linux.lua +++ b/widgets/wifiiw_linux.lua @@ -26,6 +26,7 @@ function wifiiw_linux.async(format, warg, callback) local winfo = {} local function parse_link(stdout) + winfo["{bssid}"] = stdout:match"Connected to ([%x:]*)" or "N/A" winfo["{ssid}"] = stdout:match"SSID: ([^\n]*)" or "N/A" winfo["{freq}"] = tonumber(stdout:match"freq: (%d+)" or 0) winfo["{sign}"] = -- Signal level can be negative; w/o unit (dBm)