X-Git-Url: https://git.madduck.net/etc/awesome.git/blobdiff_plain/8d3868d7ce528cfc075e246c8935bae2724e0868..81c816eb8d566dd8e75ce0d9040650f0c905145a:/widget/contrib/moc.lua diff --git a/widget/contrib/moc.lua b/widget/contrib/moc.lua index fda50fc..83d8aaf 100644 --- a/widget/contrib/moc.lua +++ b/widget/contrib/moc.lua @@ -15,13 +15,12 @@ local wibox = require("wibox") local os = { getenv = os.getenv } local string = { format = string.format, gmatch = string.gmatch } -local setmetatable = setmetatable -- MOC audio player -- lain.widget.contrib.moc -local moc = {} -local function worker(args) +local function factory(args) + local moc = { widget = wibox.widget.textbox() } local args = args or {} local timeout = args.timeout or 2 local music_dir = args.music_dir or os.getenv("HOME") .. "/Music" @@ -31,8 +30,6 @@ local function worker(args) local followtag = args.followtag or false local settings = args.settings or function() end - moc.widget = wibox.widget.textbox() - moc_notification_preset = { title = "Now playing", timeout = 6 } helpers.set_map("current moc track", nil) @@ -98,4 +95,4 @@ local function worker(args) return moc end -return setmetatable(moc, { __call = function(_, ...) return worker(...) end }) +return factory