aboutsummaryrefslogtreecommitdiff
path: root/widgets/wifi.lua
diff options
context:
space:
mode:
Diffstat (limited to 'widgets/wifi.lua')
-rw-r--r--widgets/wifi.lua20
1 files changed, 10 insertions, 10 deletions
diff --git a/widgets/wifi.lua b/widgets/wifi.lua
index 61dee12..2e400bc 100644
--- a/widgets/wifi.lua
+++ b/widgets/wifi.lua
@@ -21,20 +21,20 @@ local string = {
module("vicious.widgets.wifi")
+-- Initialize function tables
+local winfo = {
+ ["{ssid}"] = "N/A",
+ ["{mode}"] = "N/A",
+ ["{chan}"] = 0,
+ ["{rate}"] = 0,
+ ["{link}"] = 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,
- ["{sign}"] = 0
- }
-
-- Get data from iwconfig where available
local iwconfig = "/sbin/iwconfig"
local f = io.open(iwconfig, "rb")