X-Git-Url: https://git.madduck.net/etc/awesome.git/blobdiff_plain/d9877c4bedca550478507f268f43e137e4454c24..b14eff9b1e5558b3d3ea47d5e6ac9d6db3d265de:/widgets/temp.lua?ds=sidebyside diff --git a/widgets/temp.lua b/widgets/temp.lua index e769b25..1c7e86c 100644 --- a/widgets/temp.lua +++ b/widgets/temp.lua @@ -6,7 +6,7 @@ --]] -local newtimer = require("lain.helpers").newtimer +local helpers = require("lain.helpers") local wibox = require("wibox") local io = { open = io.open } local tonumber = tonumber @@ -24,7 +24,7 @@ local function worker(args) temp.widget = wibox.widget.textbox() - function update() + function temp.update() local f = io.open(tempfile) if f then coretemp_now = tonumber(f:read("*all")) / 1000 @@ -37,9 +37,9 @@ local function worker(args) settings() end - newtimer("coretemp", timeout, update) + helpers.newtimer("coretemp", timeout, temp.update) - return setmetatable(temp, { __index = temp.widget }) + return temp end return setmetatable(temp, { __call = function(_, ...) return worker(...) end })