X-Git-Url: https://git.madduck.net/etc/awesome.git/blobdiff_plain/046b0279b0f3eb827bcc2b2e395e6ea69c019733..04138e56b6341984b8a27af50f88d38ffb9a67da:/widgets/imap.lua?ds=sidebyside diff --git a/widgets/imap.lua b/widgets/imap.lua index 94652b6..f06660b 100644 --- a/widgets/imap.lua +++ b/widgets/imap.lua @@ -33,10 +33,9 @@ function worker(args) local port = args.port or "993" local refresh_timeout = args.refresh_timeout or 60 - local header = args.header or " Mail " + local header = args.header or "Mail " local header_color = args.header_color or beautiful.fg_normal or "#FFFFFF" - local color_newmail = args.color_newmail or beautiful.fg_focus or "#FFFFFF" - local color_nomail = args.color_nomail or beautiful.fg_normal or "#FFFFFF" + local color = args.color or beautiful.fg_focus or "#FFFFFF" local mail_encoding = args.mail_encoding or nil local maxlen = args.maxlen or 200 local app = args.app or "mutt" @@ -63,7 +62,7 @@ function worker(args) then myimapcheck:set_text('') else - myimapcheck:set_markup(markup(color_nomail, " no mail ")) + myimapcheck:set_markup(markup(color, " no mail ")) end end @@ -97,8 +96,8 @@ function worker(args) elseif ws:find("CheckMailError: invalid credentials") ~= nil then helpers.set_map(mail, true) - myimapcheck.set_markup(markup(header_color, header) .. - markup(color_newmail, "invalid credentials ")) + myimapcheck:set_markup(" " .. markup(header_color, header) .. + markup(color, "invalid credentials ")) else mailcount = ws:match("%d") or "?" @@ -108,8 +107,8 @@ function worker(args) helpers.set_map(mail .. " count", mailcount) end - myimapcheck:set_markup(markup(header_color, header) .. - markup(color_newmail, mailcount) .. " ") + myimapcheck:set_markup(" " .. markup(header_color, header) .. + markup(color, mailcount) .. " ") if helpers.get_map(mail) then @@ -137,7 +136,7 @@ function worker(args) end naughty.notify({ title = notify_title, - fg = color_newmail, + fg = color, text = ws, icon = beautiful.lain_mail_notify or helpers.icons_dir .. "mail.png",