X-Git-Url: https://git.madduck.net/etc/awesome.git/blobdiff_plain/f37a31878edfb59d56c2b0fde04ae80c46a8809e..fa9fb11a7c3eeb186a17c6d93c5da37eb6929d58:/widgets/abase.lua?ds=sidebyside diff --git a/widgets/abase.lua b/widgets/abase.lua index 075d615..fb20d76 100644 --- a/widgets/abase.lua +++ b/widgets/abase.lua @@ -12,7 +12,7 @@ local wibox = require("wibox") local setmetatable = setmetatable --- Basic template for custom widgets +-- Basic template for custom widgets -- Asynchronous version -- lain.widgets.abase @@ -27,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