X-Git-Url: https://git.madduck.net/etc/awesome.git/blobdiff_plain/8d3868d7ce528cfc075e246c8935bae2724e0868..724c7b9a3a27e5de2077f388832167ae91e9f29c:/widget/contrib/moc.lua?ds=inline diff --git a/widget/contrib/moc.lua b/widget/contrib/moc.lua index fda50fc..f429c77 100644 --- a/widget/contrib/moc.lua +++ b/widget/contrib/moc.lua @@ -1,9 +1,8 @@ - --[[ - - Licensed under GNU General Public License v2 - * (c) 2014, anticlockwise - + + Licensed under GNU General Public License v2 + * (c) 2014, anticlockwise + --]] local helpers = require("lain.helpers") @@ -12,16 +11,14 @@ local focused = require("awful.screen").focused local escape_f = require("awful.util").escape local naughty = require("naughty") local wibox = require("wibox") -local os = { getenv = os.getenv } -local string = { format = string.format, - gmatch = string.gmatch } -local setmetatable = setmetatable +local os = os +local string = string -- 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 +28,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 +93,4 @@ local function worker(args) return moc end -return setmetatable(moc, { __call = function(_, ...) return worker(...) end }) +return factory