X-Git-Url: https://git.madduck.net/etc/awesome.git/blobdiff_plain/6603c641c6ce675b010ca1977423747ca55d8795..7de62e4d9fe0d3a7521fc72a66c905d6f343c27b:/widgets/maildir.lua?ds=inline diff --git a/widgets/maildir.lua b/widgets/maildir.lua index cb96a30..8cb821d 100644 --- a/widgets/maildir.lua +++ b/widgets/maildir.lua @@ -14,6 +14,7 @@ local wibox = require("wibox") local util = require("lain.util") +local io = { popen = io.popen } local os = { getenv = os.getenv } local pairs = pairs local string = { len = string.len, @@ -24,7 +25,7 @@ local setmetatable = setmetatable -- Maildir check -- lain.widgets.maildir -local maildir = {} +local maildir = { total = 0 } local function worker(args) local args = args or {} @@ -64,7 +65,7 @@ local function worker(args) end until line == nil - p:close() + p:close() table.sort(boxes) newmail = "no mail" @@ -87,8 +88,10 @@ local function worker(args) end end - widget = maildir.widget - settings() + if maildir.total ~= total then + widget = maildir.widget + settings() + end end newtimer(mailpath, timeout, update, true)