X-Git-Url: https://git.madduck.net/etc/awesome.git/blobdiff_plain/ddbf283f0ebbc6772d485fe76c5dccf338d3b837..2c1eb09080947d4f587e001497f12c6084babffa:/widgets/temp.lua?ds=sidebyside diff --git a/widgets/temp.lua b/widgets/temp.lua index 4d8a727..1c7e86c 100644 --- a/widgets/temp.lua +++ b/widgets/temp.lua @@ -14,7 +14,7 @@ local setmetatable = setmetatable -- coretemp -- lain.widgets.temp -local temp = helpers.make_widget_textbox() +local temp = {} local function worker(args) local args = args or {} @@ -22,7 +22,9 @@ local function worker(args) local tempfile = args.tempfile or "/sys/class/thermal/thermal_zone0/temp" local settings = args.settings or function() end - function update() + temp.widget = wibox.widget.textbox() + + function temp.update() local f = io.open(tempfile) if f then coretemp_now = tonumber(f:read("*all")) / 1000 @@ -35,7 +37,7 @@ local function worker(args) settings() end - helpers.newtimer("coretemp", timeout, update) + helpers.newtimer("coretemp", timeout, temp.update) return temp end