X-Git-Url: https://git.madduck.net/etc/awesome.git/blobdiff_plain/0b80b45bc9bca17f08e8055d364bac17f96129bd..fd35485c200a52c9429f9a4f3f5c8282b64dba30:/widgets/abase.lua?ds=sidebyside diff --git a/widgets/abase.lua b/widgets/abase.lua index 98f7818..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) @@ -28,8 +27,11 @@ local function worker(args) function abase.update() async.request(cmd, function(f) output = f - widget = abase.widget - settings() + if output ~= abase.prev then + widget = abase.widget + settings() + abase.prev = output + end end) end