local wibox = require("wibox") local gears = require("gears") local widgets = {} function widgets.watchfn(callback, timeout, base_widget) local widget = (base_widget or wibox.widget.textbox)() gears.timer({ timeout = timeout or 5, call_now = true, autostart = true, callback = function() callback(widget) end }) return widget end return widgets