X-Git-Url: https://git.madduck.net/etc/awesome.git/blobdiff_plain/ece196a6b092b8d90218a920d1e1a43e51a367f2..f1876661b8ea65d3df2a2f2f82125be7cc6b955e:/widgets/abase.lua?ds=sidebyside diff --git a/widgets/abase.lua b/widgets/abase.lua index 20cc955..fb20d76 100644 --- a/widgets/abase.lua +++ b/widgets/abase.lua @@ -10,10 +10,9 @@ local newtimer = require("lain.helpers").newtimer local async = require("lain.asyncshell") local wibox = require("wibox") -local io = io local setmetatable = setmetatable --- Basic template for custom widgets +-- Basic template for custom widgets -- Asynchronous version -- lain.widgets.abase @@ -28,10 +27,12 @@ local function worker(args) function abase.update() async.request(cmd, function(f) - output = f:read("*a") - f:close() - widget = abase.widget - settings() + output = f + if output ~= abase.prev then + widget = abase.widget + settings() + abase.prev = output + end end) end