X-Git-Url: https://git.madduck.net/etc/awesome.git/blobdiff_plain/586c54a25750fd90d91c15ac8eb818b2613de582..2ddb55bc44dd0ea06e8caa40798d27f907169c07:/widget/mem.lua diff --git a/widget/mem.lua b/widget/mem.lua index cf0d314..50fff3b 100644 --- a/widget/mem.lua +++ b/widget/mem.lua @@ -7,24 +7,19 @@ --]] -local helpers = require("lain.helpers") -local wibox = require("wibox") -local gmatch = string.gmatch -local lines = io.lines -local floor = math.floor -local setmetatable = setmetatable +local helpers = require("lain.helpers") +local wibox = require("wibox") +local gmatch, lines, floor = string.gmatch, io.lines, math.floor -- Memory usage (ignoring caches) -- lain.widget.mem -local mem = {} local function factory(args) + local mem = { widget = wibox.widget.textbox() } local args = args or {} local timeout = args.timeout or 2 local settings = args.settings or function() end - mem.widget = wibox.widget.textbox() - function mem.update() mem_now = {} for line in lines("/proc/meminfo") do @@ -53,4 +48,4 @@ local function factory(args) return mem end -return setmetatable(mem, { __call = function(_, ...) return factory(...) end }) +return factory