Skip to content
Snippets Groups Projects
Commit ea7774c0 authored by Matthias Schiffer's avatar Matthias Schiffer
Browse files

gluon-alfred: add fields idletime, memory and processes to statistics

parent 7a3e8d16
No related branches found
No related tags found
No related merge requests found
return tonumber(util.trim(util.exec("cut -d' ' -f2 /proc/uptime")))
local data = fs.readfile('/proc/meminfo')
local fields = {}
for k, v in data:gmatch('([^\n:]+):%s*(%d+) kB') do
fields[k] = tonumber(v)
end
return {
total = fields.MemTotal,
free = fields.MemFree,
buffers = fields.Buffers,
cached = fields.Cached,
}
local running, total = fs.readfile('/proc/loadavg'):match('^[^ ]+ [^ ]+ [^ ]+ (%d+)/(%d+)')
return { running = tonumber(running), total = tonumber(total) }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment