X-Git-Url: https://git.madduck.net/etc/awesome.git/blobdiff_plain/d9877c4bedca550478507f268f43e137e4454c24..c155301459aa73a1b5e9a1b674be12f03021c4fe:/widgets/mem.lua?ds=sidebyside diff --git a/widgets/mem.lua b/widgets/mem.lua index e96dc1b..7b717ef 100644 --- a/widgets/mem.lua +++ b/widgets/mem.lua @@ -7,7 +7,7 @@ --]] -local newtimer = require("lain.helpers").newtimer +local helpers = require("lain.helpers") local wibox = require("wibox") local gmatch = string.gmatch local lines = io.lines @@ -25,7 +25,7 @@ local function worker(args) mem.widget = wibox.widget.textbox() - function update() + function mem.update() mem_now = {} for line in lines("/proc/meminfo") do for k, v in gmatch(line, "([%a]+):[%s]+([%d]+).+") do @@ -48,9 +48,9 @@ local function worker(args) settings() end - newtimer("mem", timeout, update) + helpers.newtimer("mem", timeout, mem.update) - return setmetatable(mem, { __index = mem.widget }) + return mem end return setmetatable(mem, { __call = function(_, ...) return worker(...) end })