X-Git-Url: https://git.madduck.net/etc/awesome.git/blobdiff_plain/52deb6911957f840a0191f73c8a9626bd9ff5086..c477cc64fd484f9cc1e1c78e9b22e1f099e75838:/widgets/imap.lua?ds=inline diff --git a/widgets/imap.lua b/widgets/imap.lua index ec7bd1f..ea763df 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('') @@ -64,10 +62,7 @@ local function worker(args) head_command, server, port, mail, password, request) async.request(curl, function(f) - ws = f:read("*all") - f:close() - - _, mailcount = string.gsub(ws, "%d+", "") + _, mailcount = string.gsub(f, "%d+", "") _ = nil widget = imap.widget