X-Git-Url: https://git.madduck.net/etc/awesome.git/blobdiff_plain/fd35485c200a52c9429f9a4f3f5c8282b64dba30..fc5974a9c2838efa8dedbd350d9623e193ab71a3:/widgets/cpu.lua?ds=sidebyside diff --git a/widgets/cpu.lua b/widgets/cpu.lua index c33c7eb..f7fb087 100644 --- a/widgets/cpu.lua +++ b/widgets/cpu.lua @@ -9,14 +9,11 @@ local lines_match = require("lain.helpers").lines_match local newtimer = require("lain.helpers").newtimer - local wibox = require("wibox") - local math = { ceil = math.ceil } local string = { format = string.format, gmatch = string.gmatch } local tostring = tostring - local setmetatable = setmetatable -- CPU usage @@ -28,7 +25,7 @@ local function worker(args) local timeout = args.timeout or 2 local settings = args.settings or function() end - cpu.widget = wibox.widget.textbox('') + cpu.widget = wibox.widget.textbox() function update() -- Read the amount of time the CPUs have spent performing @@ -80,7 +77,7 @@ local function worker(args) newtimer("cpu", timeout, update) - return cpu.widget + return setmetatable(cpu, { __index = cpu.widget }) end return setmetatable(cpu, { __call = function(_, ...) return worker(...) end })