X-Git-Url: https://git.madduck.net/etc/awesome.git/blobdiff_plain/ddbf283f0ebbc6772d485fe76c5dccf338d3b837..e46fa5a6df6474f430c40de5a2da1081731dea07:/widgets/sysload.lua diff --git a/widgets/sysload.lua b/widgets/sysload.lua index 148319d..df9dbea 100644 --- a/widgets/sysload.lua +++ b/widgets/sysload.lua @@ -15,14 +15,16 @@ local setmetatable = setmetatable -- System load -- lain.widgets.sysload -local sysload = helpers.make_widget_textbox() +local sysload = {} local function worker(args) local args = args or {} local timeout = args.timeout or 2 local settings = args.settings or function() end - function update() + sysload.widget = wibox.widget.textbox() + + function sysload.update() local f = io.open("/proc/loadavg") local ret = f:read("*all") f:close() @@ -33,7 +35,7 @@ local function worker(args) settings() end - helpers.newtimer("sysload", timeout, update) + helpers.newtimer("sysload", timeout, sysload.update) return sysload end