diff options
author | Arvydas Sidorenko <asido4@gmail.com> | 2012-06-15 17:34:25 +0200 |
---|---|---|
committer | Adrian C. (anrxc) <anrxc@sysphere.org> | 2012-06-18 01:26:24 +0200 |
commit | b6b52900930ddb2a5b958a6d314766b455358164 (patch) | |
tree | 462746dac9357edca9a9216827529db557002ebe /init.lua | |
parent | 0741531efd4bec3bd6836f8ea535e14daf5e2146 (diff) | |
download | vicious-legacy-b6b52900930ddb2a5b958a6d314766b455358164.tar.xz |
Ported vicious module to lua 5.2
Signed-off-by: Arvydas Sidorenko <asido4@gmail.com>
Signed-off-by: Adrian C. (anrxc) <anrxc@sysphere.org>
Diffstat (limited to 'init.lua')
-rw-r--r-- | init.lua | 28 |
1 files changed, 15 insertions, 13 deletions
@@ -16,13 +16,12 @@ local table = { insert = table.insert, remove = table.remove } -require("vicious.helpers") -require("vicious.widgets") ---require("vicious.contrib") --- Vicious: widgets for the awesome window manager -module("vicious") +local helpers = require("vicious.helpers") +-- Vicious: widgets for the awesome window manager +local vicious = {} +vicious.widgets = require("vicious.widgets") -- Initialize tables local timers = {} @@ -140,7 +139,7 @@ end -- {{{ Global functions -- {{{ Register a widget -function register(widget, wtype, format, timer, warg) +function vicious.register(widget, wtype, format, timer, warg) local widget = widget local reg = { -- Set properties @@ -170,12 +169,12 @@ end -- }}} -- {{{ Unregister a widget -function unregister(widget, keep, reg) +function vicious.unregister(widget, keep, reg) if reg == nil then for w, i in pairs(registered) do if w == widget then for _, v in pairs(i) do - reg = unregister(w, keep, v) + reg = vicious.unregister(w, keep, v) end end end @@ -206,7 +205,7 @@ end -- }}} -- {{{ Enable caching of a widget type -function cache(wtype) +function vicious.cache(wtype) if wtype ~= nil then if widget_cache[wtype] == nil then widget_cache[wtype] = {} @@ -216,7 +215,7 @@ end -- }}} -- {{{ Force update of widgets -function force(wtable) +function vicious.force(wtable) if type(wtable) == "table" then for _, w in pairs(wtable) do update(w, nil, true) @@ -226,17 +225,17 @@ end -- }}} -- {{{ Suspend all widgets -function suspend() +function vicious.suspend() for w, i in pairs(registered) do for _, v in pairs(i) do - unregister(w, true, v) + vicious.unregister(w, true, v) end end end -- }}} -- {{{ Activate a widget -function activate(widget) +function vicious.activate(widget) for w, i in pairs(registered) do if widget == nil or w == widget then for _, v in pairs(i) do @@ -246,4 +245,7 @@ function activate(widget) end end -- }}} + +return vicious + -- }}} |