1
1
Fork 0
mirror of https://github.com/vicious-widgets/vicious synced 2023-12-14 07:13:07 +01:00

BSSID string in wifiiw_linux module

This commit is contained in:
Xaver Hellauer 2019-07-18 12:15:33 +02:00 committed by Nguyễn Gia Phong
parent cf81341fc9
commit fe593a480e

View file

@ -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