X-Git-Url: https://git.madduck.net/etc/awesome.git/blobdiff_plain/4060898f1b9d8ae2d3adee0dd28ebf601631c975..6cdc863f0038910523e2bce56c9091ccc78f80e6:/widgets/imap.lua?ds=sidebyside diff --git a/widgets/imap.lua b/widgets/imap.lua index b3f281d..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 - 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"