X-Git-Url: https://git.madduck.net/etc/awesome.git/blobdiff_plain/b0209bd820dd5d8c6a2de893444953490f531de0..912bd26ede8901c98fd8d7a35f8493ee448109ad:/widgets/imap.lua diff --git a/widgets/imap.lua b/widgets/imap.lua index 62b33d7..350e1ad 100644 --- a/widgets/imap.lua +++ b/widgets/imap.lua @@ -43,9 +43,7 @@ local function worker(args) if not is_plain then - local f = io.popen(password) - password = f:read("*all"):gsub("\n", "") - f:close() + password = helpers.read_pipe(password):gsub("\n", "") end imap.widget = wibox.widget.textbox('') @@ -67,8 +65,10 @@ local function worker(args) _, mailcount = string.gsub(f, "%d+", "") _ = nil - widget = imap.widget - settings() + if mailcount ~= helpers.get_map(mail) then + widget = imap.widget + settings() + end if mailcount >= 1 and mailcount > helpers.get_map(mail) then