X-Git-Url: https://git.madduck.net/etc/awesome.git/blobdiff_plain/eb8cec907a50f3fd6df4b14ae10b910444017f92..e73a70c2ab26caf981d356756d4f83ad8bfbdb5a:/widgets/maildir.lua diff --git a/widgets/maildir.lua b/widgets/maildir.lua index 00ab771..4ac34bc 100644 --- a/widgets/maildir.lua +++ b/widgets/maildir.lua @@ -24,16 +24,16 @@ local setmetatable = setmetatable -- lain.widgets.maildir local maildir = {} -function worker(args) +local function worker(args) local args = args or {} local timeout = args.timeout or 60 local mailpath = args.mailpath or os.getenv("HOME") .. "/Mail" local ignore_boxes = args.ignore_boxes or {} local settings = args.settings or function() end - widget = wibox.widget.textbox('') + maildir.widget = wibox.widget.textbox('') - function update() + function maildir.update() -- Find pathes to mailboxes. local p = io.popen("find " .. mailpath .. " -mindepth 1 -maxdepth 1 -type d" .. @@ -84,12 +84,13 @@ function worker(args) end end + widget = maildir.widget settings() end - newtimer(mailpath, timeout, update, true) + newtimer(mailpath, timeout, maildir.update, true) - return widget + return maildir.widget end return setmetatable(maildir, { __call = function(_, ...) return worker(...) end })