From 304fa336ed385942ad41178dc9d0b15e71d1ac2f Mon Sep 17 00:00:00 2001 From: "Adrian C. (anrxc)" Date: Sun, 24 Oct 2010 23:36:38 +0200 Subject: wifi: properly handle disconnects --- widgets/wifi.lua | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) (limited to 'widgets/wifi.lua') diff --git a/widgets/wifi.lua b/widgets/wifi.lua index 9e8583a..4f389d0 100644 --- a/widgets/wifi.lua +++ b/widgets/wifi.lua @@ -22,21 +22,21 @@ local string = { 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 local function worker(format, warg) 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 local iwconfig = "/sbin/iwconfig" local f = io.open(iwconfig, "rb") -- cgit v1.2.3