X-Git-Url: https://git.madduck.net/etc/awesome.git/blobdiff_plain/ddbf283f0ebbc6772d485fe76c5dccf338d3b837..1555e239eb42953d6d16b04f09d4d19083fa5119:/widgets/mem.lua?ds=sidebyside 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