X-Git-Url: https://git.madduck.net/etc/awesome.git/blobdiff_plain/eb8cec907a50f3fd6df4b14ae10b910444017f92..669112020d022b3b9cb023c82230e21d36aa88cf:/widgets/cpu.lua?ds=sidebyside diff --git a/widgets/cpu.lua b/widgets/cpu.lua index f9bbe72..55a3799 100644 --- a/widgets/cpu.lua +++ b/widgets/cpu.lua @@ -31,7 +31,7 @@ local function worker(args) local timeout = args.timeout or 5 local settings = args.settings or function() end - widget = wibox.widget.textbox('') + cpu.widget = wibox.widget.textbox('') function update() -- Read the amount of time the CPUs have spent performing @@ -60,6 +60,7 @@ local function worker(args) usage = tostring(math.ceil((dactive / dtotal) * 100)) + widget = cpu.widget settings() -- Save current data for the next run. @@ -69,7 +70,7 @@ local function worker(args) newtimer("cpu", timeout, update) - return widget + return cpu.widget end return setmetatable(cpu, { __call = function(_, ...) return worker(...) end })