aboutsummaryrefslogtreecommitdiff
path: root/init.lua
diff options
context:
space:
mode:
authorAdrian C. (anrxc) <anrxc@sysphere.org>2010-03-14 01:55:33 +0100
committerAdrian C. (anrxc) <anrxc@sysphere.org>2010-03-14 01:55:33 +0100
commit237470c8f45190b213e3a173ce6ae1a74b3e11fe (patch)
tree7f53c8144761947d4bde20715bcad34f4be0d6c0 /init.lua
parent9a82d4113a8271b7dfc7506f2b07379e3ede89a8 (diff)
downloadvicious-legacy-237470c8f45190b213e3a173ce6ae1a74b3e11fe.tar.xz
API: transform widgets namespace table to a directory
Diffstat (limited to 'init.lua')
-rw-r--r--init.lua54
1 files changed, 5 insertions, 49 deletions
diff --git a/init.lua b/init.lua
index 73d382d..7eb0159 100644
--- a/init.lua
+++ b/init.lua
@@ -6,71 +6,27 @@
-- * (c) 2009, Lucas de Vries <lucas@glacicle.com>
---------------------------------------------------
--- {{{ Grab environment
+-- {{{ Setup environment
local type = type
local pairs = pairs
local tonumber = tonumber
-local helpers = require("vicious.helpers")
local capi = { timer = timer }
local os = { time = os.time }
local table = {
insert = table.insert,
remove = table.remove
}
--- }}}
-
-
--- {{{ Configure widgets
-require("vicious.cpu")
-require("vicious.cpuinf")
-require("vicious.cpufreq")
-require("vicious.thermal")
-require("vicious.uptime")
-require("vicious.bat")
-require("vicious.mem")
-require("vicious.os")
-require("vicious.fs")
-require("vicious.dio")
-require("vicious.hddtemp")
-require("vicious.net")
-require("vicious.wifi")
-require("vicious.mbox")
-require("vicious.mboxc")
-require("vicious.mdir")
-require("vicious.gmail")
-require("vicious.entropy")
-require("vicious.org")
-require("vicious.pkg")
-require("vicious.mpd")
-require("vicious.volume")
-require("vicious.weather")
-require("vicious.date")
--- }}}
+require("vicious.helpers")
+require("vicious.widgets")
-- Vicious: widgets for the awesome window manager
module("vicious")
--- {{{ Initialize tables
+-- Initialize tables
local timers = {}
local registered = {}
local widget_cache = {}
-
--- Initialize the function table
-widgets = {}
--- }}}
-
--- {{{ Widget types
-for i, w in pairs(_M) do
- -- Ensure we don't call ourselves
- if w and w ~= _M and type(w) == "table" then
- -- Ignore the function table and helpers
- if i ~= "widgets" and i ~= "helpers" then
- -- Place widgets in the namespace table
- widgets[i] = w
- end
- end
-end
-- }}}
@@ -173,7 +129,7 @@ end
-- }}}
--- {{{ Exposed functions
+-- {{{ Global functions
-- {{{ Register a widget
function register(widget, wtype, format, timer, warg)
local reg = {}