X-Git-Url: https://git.madduck.net/etc/awesome.git/blobdiff_plain/8af4a03c754fa1bcac24736633f1b3be8ce8888c..de67546f6eee871026c67620997a392037dc4d7a:/widgets/imap.lua diff --git a/widgets/imap.lua b/widgets/imap.lua index 605c1c4..febff23 100644 --- a/widgets/imap.lua +++ b/widgets/imap.lua @@ -61,14 +61,13 @@ local function worker(args) ws = f:read("*all") f:close() - t, mailcount = string.gsub(ws, "%d", "") - t = nil -- because it's useless - mailcount = tonumber(mailcount) + _, mailcount = string.gsub(ws, "%d+", "") + _ = nil widget = imap.widget settings() - if mailcount > helpers.get_map(mail) and mailcount >= 1 + if mailcount >= 1 and mailcount > helpers.get_map(mail) then if mailcount == 1 then nt = mail .. " has one new message"