wifi: properly handle disconnects
This commit is contained in:
parent
32a7be1d6d
commit
304fa336ed
|
@ -22,21 +22,21 @@ local string = {
|
||||||
module("vicious.widgets.wifi")
|
module("vicious.widgets.wifi")
|
||||||
|
|
||||||
|
|
||||||
-- Initialize function tables
|
|
||||||
local winfo = {
|
|
||||||
["{ssid}"] = "N/A",
|
|
||||||
["{mode}"] = "N/A",
|
|
||||||
["{chan}"] = 0,
|
|
||||||
["{rate}"] = 0,
|
|
||||||
["{link}"] = 0,
|
|
||||||
["{linp}"] = 0,
|
|
||||||
["{sign}"] = 0
|
|
||||||
}
|
|
||||||
|
|
||||||
-- {{{ Wireless widget type
|
-- {{{ Wireless widget type
|
||||||
local function worker(format, warg)
|
local function worker(format, warg)
|
||||||
if not warg then return end
|
if not warg then return end
|
||||||
|
|
||||||
|
-- Default values
|
||||||
|
local winfo = {
|
||||||
|
["{ssid}"] = "N/A",
|
||||||
|
["{mode}"] = "N/A",
|
||||||
|
["{chan}"] = 0,
|
||||||
|
["{rate}"] = 0,
|
||||||
|
["{link}"] = 0,
|
||||||
|
["{linp}"] = 0,
|
||||||
|
["{sign}"] = 0
|
||||||
|
}
|
||||||
|
|
||||||
-- Get data from iwconfig where available
|
-- Get data from iwconfig where available
|
||||||
local iwconfig = "/sbin/iwconfig"
|
local iwconfig = "/sbin/iwconfig"
|
||||||
local f = io.open(iwconfig, "rb")
|
local f = io.open(iwconfig, "rb")
|
||||||
|
|
Loading…
Reference in New Issue