X-Git-Url: https://git.madduck.net/etc/awesome.git/blobdiff_plain/6cce5b6fe11fe8c69b08140d645c604fef59e42a..e46fa5a6df6474f430c40de5a2da1081731dea07:/widgets/temp.lua diff --git a/widgets/temp.lua b/widgets/temp.lua index 9c82b8b..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,9 +24,8 @@ local function worker(args) temp.widget = wibox.widget.textbox() - function update() + function temp.update() local f = io.open(tempfile) - local coretemp_now if f then coretemp_now = tonumber(f:read("*all")) / 1000 f:close() @@ -38,9 +37,9 @@ local function worker(args) settings() end - newtimer("coretemp", timeout, update) + helpers.newtimer("coretemp", timeout, temp.update) - return temp.widget + return temp end return setmetatable(temp, { __call = function(_, ...) return worker(...) end })