X-Git-Url: https://git.madduck.net/etc/awesome.git/blobdiff_plain/7e4175f7aaef5c690afca3bc987107e2193a58df..0279482eeb5867f49b4efc83d591393f9c3d0adb:/widgets/imap.lua?ds=inline diff --git a/widgets/imap.lua b/widgets/imap.lua index 06b4245..3caf31a 100644 --- a/widgets/imap.lua +++ b/widgets/imap.lua @@ -7,7 +7,6 @@ --]] local helpers = require("lain.helpers") -local async = require("lain.asyncshell") local naughty = require("naughty") local wibox = require("wibox") @@ -59,24 +58,19 @@ local function worker(args) curl = string.format("%s --url imaps://%s:%s/INBOX -u %s:%q %s -k", head_command, server, port, mail, password, request) - async.request(curl, function(f) + helpers.async(curl, function(f) _, mailcount = string.gsub(f, "%d+", "") - _ = nil widget = imap.widget settings() - if mailcount >= 1 and mailcount > helpers.get_map(mail) - then + if mailcount >= 1 and mailcount > helpers.get_map(mail) then if mailcount == 1 then nt = mail .. " has one new message" else nt = mail .. " has " .. mailcount .. " new messages" end - naughty.notify({ - preset = mail_notification_preset, - text = nt - }) + naughty.notify({ preset = mail_notification_preset, text = nt }) end helpers.set_map(mail, mailcount)