X-Git-Url: https://git.madduck.net/etc/awesome.git/blobdiff_plain/ddbf283f0ebbc6772d485fe76c5dccf338d3b837..ae4b9b272802c0690b711644508d63a538a3e1cd:/widgets/mem.lua diff --git a/widgets/mem.lua b/widgets/mem.lua index ff5816c..7b717ef 100644 --- a/widgets/mem.lua +++ b/widgets/mem.lua @@ -16,14 +16,16 @@ local setmetatable = setmetatable -- Memory usage (ignoring caches) -- lain.widgets.mem -local mem = helpers.make_widget_textbox() +local mem = {} local function worker(args) local args = args or {} local timeout = args.timeout or 2 local settings = args.settings or function() end - function update() + mem.widget = wibox.widget.textbox() + + function mem.update() mem_now = {} for line in lines("/proc/meminfo") do for k, v in gmatch(line, "([%a]+):[%s]+([%d]+).+") do @@ -46,7 +48,7 @@ local function worker(args) settings() end - helpers.newtimer("mem", timeout, update) + helpers.newtimer("mem", timeout, mem.update) return mem end