From: Luca CPZ Date: Thu, 30 Aug 2018 14:02:41 +0000 (+0200) Subject: widget.imap: ensure to get unseen messages; #400 X-Git-Url: https://git.madduck.net/etc/awesome.git/commitdiff_plain/53ebca2867c5d9c9ab7c5d3f37ccc91784322cd7?hp=4dbf7b9f5bb468de2003e93f5ab19371e663bfce widget.imap: ensure to get unseen messages; #400 --- diff --git a/widget/imap.lua b/widget/imap.lua index 7c13223..93aced9 100644 --- a/widget/imap.lua +++ b/widget/imap.lua @@ -9,8 +9,7 @@ local helpers = require("lain.helpers") local naughty = require("naughty") local wibox = require("wibox") local awful = require("awful") -local string = { format = string.format, - gsub = string.gsub } +local string = string local type = type local tonumber = tonumber @@ -59,7 +58,7 @@ local function factory(args) head_command, server, port, mail, password, request) helpers.async(curl, function(f) - _, mailcount = string.gsub(f, "%d+", "") + mailcount = tonumber(f:match("UNSEEN (%d+)")) widget = imap.widget settings()