aboutsummaryrefslogtreecommitdiff
path: root/mpd.lua
diff options
context:
space:
mode:
authorAdrian C. (anrxc) <anrxc@sysphere.org>2009-08-01 23:11:41 +0200
committerAdrian C. (anrxc) <anrxc@sysphere.org>2009-08-01 23:11:41 +0200
commit418151f57ebe56b84e35169e73912fe244871db5 (patch)
treeb25f130d73deeb91d8dcb9bb8b728b3af6aaba05 /mpd.lua
parent1630b786d4028a8075695c026391ee80cc9b9aca (diff)
downloadvicious-legacy-418151f57ebe56b84e35169e73912fe244871db5.tar.xz
Make all widgets return their worker functions when called.
Diffstat (limited to 'mpd.lua')
-rw-r--r--mpd.lua5
1 files changed, 4 insertions, 1 deletions
diff --git a/mpd.lua b/mpd.lua
index 2dc95f8..f8c0400 100644
--- a/mpd.lua
+++ b/mpd.lua
@@ -5,6 +5,7 @@
-- {{{ Grab environment
local io = { popen = io.popen }
+local setmetatable = setmetatable
local helpers = require("vicious.helpers")
-- }}}
@@ -14,7 +15,7 @@ module("vicious.mpd")
-- {{{ MPD widget type
-function worker()
+function worker(format)
-- This one is as simple as they come. Using sockets or expanding
-- it is a lost cause since there are already a few MPD Lua libs
-- written for awesome. Use them.
@@ -40,3 +41,5 @@ function worker()
return {nowplaying}
end
-- }}}
+
+setmetatable(_M, { __call = function(_, ...) return worker(...) end })