X-Git-Url: https://git.madduck.net/etc/awesome.git/blobdiff_plain/49f3712ce7efa219cec97f97a2acf2b646511855..64540340dbe9071bc716c73ca4c90df14fdd6302:/widgets/mpd.lua diff --git a/widgets/mpd.lua b/widgets/mpd.lua index 24cdcda..c9b3de5 100644 --- a/widgets/mpd.lua +++ b/widgets/mpd.lua @@ -26,7 +26,7 @@ local setmetatable = setmetatable -- MPD infos -- lain.widgets.mpd -local mpd = {} +local mpd = helpers.make_widget_textbox() local function worker(args) local args = args or {} @@ -46,8 +46,6 @@ local function worker(args) local mpdh = "telnet://" .. host .. ":" .. port local echo = echo_cmd .. " 'password " .. password .. "\nstatus\ncurrentsong\nclose'" - mpd.widget = wibox.widget.textbox('') - mpd_notification_preset = { title = "Now playing", timeout = 6 @@ -139,7 +137,7 @@ local function worker(args) helpers.newtimer("mpd", timeout, mpd.update) - return setmetatable(mpd, { __index = mpd.widget }) + return mpd end return setmetatable(mpd, { __call = function(_, ...) return worker(...) end })