aboutsummaryrefslogtreecommitdiff
path: root/init.lua
diff options
context:
space:
mode:
authorAdrian C. (anrxc) <anrxc@sysphere.org>2010-03-07 03:09:44 +0100
committerAdrian C. (anrxc) <anrxc@sysphere.org>2010-03-07 03:09:44 +0100
commitee64644ddcec5b6a58a5b5e58477b2eb60588396 (patch)
tree04ed9898d0d95c6fd448f134927f84844ac39537 /init.lua
parent95e9a771b9f9b23ace3383073c4b3d25faf8ca84 (diff)
downloadvicious-legacy-ee64644ddcec5b6a58a5b5e58477b2eb60588396.tar.xz
API: added force() function to force update widgets
New function introduced vicious.force({ widget, }) - widget argument is a table with one or more widgets that will be updated.
Diffstat (limited to 'init.lua')
-rw-r--r--init.lua12
1 files changed, 12 insertions, 0 deletions
diff --git a/init.lua b/init.lua
index aec420e..b4f38f3 100644
--- a/init.lua
+++ b/init.lua
@@ -72,6 +72,7 @@ for i, w in pairs(_M) do
end
-- }}}
+
-- {{{ Local functions
-- {{{ Update a widget
local function update(widget, reg, disablecache)
@@ -170,6 +171,7 @@ end
-- }}}
-- }}}
+
-- {{{ Exposed functions
-- {{{ Register a widget
function register(widget, wtype, format, timer, warg)
@@ -245,6 +247,16 @@ function cache(type)
end
-- }}}
+-- {{{ Force update of widgets
+function force(widgets)
+ if type(widgets) == "table" then
+ for _, w in pairs(widgets) do
+ update(w, nil, true)
+ end
+ end
+end
+-- }}}
+
-- {{{ Suspend all widgets
function suspend()
for w, i in pairs(registered) do