X-Git-Url: https://git.madduck.net/etc/awesome.git/blobdiff_plain/229d2545dd399b52c6128a823657c6266fbbe8a9..1555e239eb42953d6d16b04f09d4d19083fa5119:/widgets/abase.lua?ds=inline diff --git a/widgets/abase.lua b/widgets/abase.lua index 409495b..300cc1b 100644 --- a/widgets/abase.lua +++ b/widgets/abase.lua @@ -7,22 +7,22 @@ --]] local helpers = require("lain.helpers") -local wibox = require("wibox") +local textbox = require("wibox.widget.textbox") local setmetatable = setmetatable --- Basic template for custom widgets (asynchronous version) +-- Template for custom asynchronous widgets -- lain.widgets.abase local function worker(args) - local abase = { widget = wibox.widget.textbox() } + local abase = {} local args = args or {} local timeout = args.timeout or 5 local nostart = args.nostart or false local stoppable = args.stoppable or false local cmd = args.cmd - local settings = args.settings or function() end + local settings = args.settings or function() widget:set_text(output) end - abase.widget = wibox.widget.textbox() + abase.widget = args.widget or textbox() function abase.update() helpers.async(cmd, function(f)