X-Git-Url: https://git.madduck.net/etc/awesome.git/blobdiff_plain/293091d2674bb5b37d461b7989a39b7048800794..3a2e5e0a8a7557f3c5eb73171ac80da57ef582ac:/widgets/abase.lua?ds=sidebyside diff --git a/widgets/abase.lua b/widgets/abase.lua index 1c132cd..60d86ab 100644 --- a/widgets/abase.lua +++ b/widgets/abase.lua @@ -12,8 +12,7 @@ local wibox = require("wibox") local setmetatable = setmetatable --- Basic template for custom widgets --- Asynchronous version +-- Basic template for custom widgets (asynchronous version) -- lain.widgets.abase local function worker(args) @@ -27,10 +26,12 @@ local function worker(args) function abase.update() async.request(cmd, function(f) - output = f:read("*all") - f:close() - widget = abase.widget - settings() + output = f + if output ~= abase.prev then + widget = abase.widget + settings() + abase.prev = output + end end) end