X-Git-Url: https://git.madduck.net/etc/awesome.git/blobdiff_plain/d9877c4bedca550478507f268f43e137e4454c24..c155301459aa73a1b5e9a1b674be12f03021c4fe:/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 })