X-Git-Url: https://git.madduck.net/etc/awesome.git/blobdiff_plain/49a4df385e953156e6d1e2ee0bcfd07d8501d0f4..a274576cfd89c1475aa6b9149ad25fdd5cda1060:/widgets/contrib/tpbat/init.lua?ds=sidebyside diff --git a/widgets/contrib/tpbat/init.lua b/widgets/contrib/tpbat/init.lua index 32a2527..20a10f4 100644 --- a/widgets/contrib/tpbat/init.lua +++ b/widgets/contrib/tpbat/init.lua @@ -28,7 +28,7 @@ local smapi = require("smapi") -- ThinkPad SMAPI-enabled battery info widget -- lain.widgets.contrib.tpbat -local tpbat = { } +local tpbat = {} function tpbat.hide() if not tpbat.notification then return end @@ -39,7 +39,7 @@ end function tpbat.show(t_out) tpbat.hide() - local bat = tpbat.bat + local bat = tpbat.bat if bat == nil or not bat:installed() then return end @@ -108,7 +108,7 @@ function tpbat.register(args) }) end - function update() + function tpbat.update() bat_now = { status = "Not present", perc = "N/A", @@ -151,12 +151,12 @@ function tpbat.register(args) settings() end - newtimer("tpbat-" .. bat.name, timeout, update) + newtimer("tpbat-" .. bat.name, timeout, tpbat.update) widget:connect_signal('mouse::enter', function () tpbat.show() end) widget:connect_signal('mouse::leave', function () tpbat.hide() end) - return tpbat.widget + return tpbat end return setmetatable(tpbat, { __call = function(_, ...) return tpbat.register(...) end })