forgot to refix #141

This commit is contained in:
Luke Bonham 2015-10-25 10:02:40 +01:00
parent 0b80b45bc9
commit 2b8a2bc2ae
1 changed files with 3 additions and 3 deletions

View File

@ -21,9 +21,9 @@ local setmetatable = setmetatable
-- Battery infos
-- lain.widgets.bat
local bat = {}
local function worker(args)
local bat = {}
local args = args or {}
local timeout = args.timeout or 30
local battery = args.battery or "BAT0"
@ -143,7 +143,7 @@ local function worker(args)
newtimer(battery, timeout, update)
return bat.widget
return setmetatable(bat, { __index = bat.widget })
end
return setmetatable(bat, { __call = function(_, ...) return worker(...) end })
return setmetatable({}, { __call = function(_, ...) return worker(...) end })