From 2b8a2bc2ae974072cb48e293db0c05e9517cff06 Mon Sep 17 00:00:00 2001 From: Luke Bonham Date: Sun, 25 Oct 2015 10:02:40 +0100 Subject: [PATCH] forgot to refix #141 --- widgets/bat.lua | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/widgets/bat.lua b/widgets/bat.lua index 626239b..61828ec 100644 --- a/widgets/bat.lua +++ b/widgets/bat.lua @@ -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 }) -- 2.39.5