X-Git-Url: https://git.madduck.net/etc/awesome.git/blobdiff_plain/d9877c4bedca550478507f268f43e137e4454c24..2c1eb09080947d4f587e001497f12c6084babffa:/widgets/bat.lua?ds=inline diff --git a/widgets/bat.lua b/widgets/bat.lua index 8b62790..e479fd9 100644 --- a/widgets/bat.lua +++ b/widgets/bat.lua @@ -8,7 +8,6 @@ --]] local first_line = require("lain.helpers").first_line -local make_widget = require("lain.helpers").make_widget_textbox local newtimer = require("lain.helpers").newtimer local naughty = require("naughty") local wibox = require("wibox") @@ -26,7 +25,7 @@ local setmetatable = setmetatable -- lain.widgets.bat local function worker(args) - local bat = make_widget() + local bat = { widget = wibox.widget.textbox() } local args = args or {} local timeout = args.timeout or 30 local batteries = args.batteries or (args.battery and {args.battery}) or {"BAT0"} @@ -176,8 +175,8 @@ local function worker(args) end newtimer("batteries", timeout, bat.update) - - return setmetatable(bat, { __index = bat.widget }) + + return bat end return setmetatable({}, { __call = function(_, ...) return worker(...) end })