mirror of https://github.com/lcpz/lain.git
forgot to refix #141
This commit is contained in:
parent
0b80b45bc9
commit
2b8a2bc2ae
|
@ -21,9 +21,9 @@ local setmetatable = setmetatable
|
||||||
|
|
||||||
-- Battery infos
|
-- Battery infos
|
||||||
-- lain.widgets.bat
|
-- lain.widgets.bat
|
||||||
local bat = {}
|
|
||||||
|
|
||||||
local function worker(args)
|
local function worker(args)
|
||||||
|
local bat = {}
|
||||||
local args = args or {}
|
local args = args or {}
|
||||||
local timeout = args.timeout or 30
|
local timeout = args.timeout or 30
|
||||||
local battery = args.battery or "BAT0"
|
local battery = args.battery or "BAT0"
|
||||||
|
@ -143,7 +143,7 @@ local function worker(args)
|
||||||
|
|
||||||
newtimer(battery, timeout, update)
|
newtimer(battery, timeout, update)
|
||||||
|
|
||||||
return bat.widget
|
return setmetatable(bat, { __index = bat.widget })
|
||||||
end
|
end
|
||||||
|
|
||||||
return setmetatable(bat, { __call = function(_, ...) return worker(...) end })
|
return setmetatable({}, { __call = function(_, ...) return worker(...) end })
|
||||||
|
|
Loading…
Reference in New Issue