X-Git-Url: https://git.madduck.net/etc/awesome.git/blobdiff_plain/763805f5add904469b12167ef594e1890dc304dd..272844030a05df1807406245b84930ea4740e61b:/widgets/imap.lua diff --git a/widgets/imap.lua b/widgets/imap.lua index 1e86738..e00be5b 100644 --- a/widgets/imap.lua +++ b/widgets/imap.lua @@ -7,14 +7,11 @@ --]] local helpers = require("lain.helpers") - local naughty = require("naughty") local wibox = require("wibox") - local string = { format = string.format, gsub = string.gsub } local tonumber = tonumber - local setmetatable = setmetatable -- Mail IMAP check @@ -35,6 +32,8 @@ local function worker(args ) local head_command = "curl --connect-timeout 3 -fsm 3" local request = "-X 'SEARCH (UNSEEN)'" + if not server or not mail or not password then return end + helpers.set_map(mail, 0) if not is_plain then @@ -56,6 +55,7 @@ local function worker(args ) helpers.async(curl, function(f) _, mailcount = string.gsub(f, "%d+", "") + _ = nil widget = imap.widget settings()