Added missing poolsize info to the README + minor change in fs.lua
This commit is contained in:
parent
798036e445
commit
8b38567d75
2
README
2
README
|
@ -143,6 +143,8 @@ vicious.widgets.mdir
|
|||
|
||||
vicious.widgets.entropy
|
||||
- provides available system entropy
|
||||
- takes the poolsize as an argument, or fallbacks to Linux 2.6
|
||||
default entropy pool of 4096-bits
|
||||
|
||||
vicious.widgets.org
|
||||
- provides agenda statistics for Emacs org-mode
|
||||
|
|
|
@ -19,9 +19,7 @@ module("vicious.entropy")
|
|||
function worker(format, poolsize)
|
||||
-- Don't waste time opening the poolsize, Linux 2.6 has a default
|
||||
-- entropy pool of 4096-bits, if needed specify otherwise
|
||||
if poolsize == nil then
|
||||
poolsize = 4096
|
||||
end
|
||||
if poolsize == nil then poolsize = 4096 end
|
||||
|
||||
-- Get available entropy
|
||||
local f = io.open("/proc/sys/kernel/random/entropy_avail")
|
||||
|
|
12
fs.lua
12
fs.lua
|
@ -17,7 +17,7 @@ module("vicious.fs")
|
|||
function worker(format)
|
||||
-- Get data from df
|
||||
local f = io.popen("df -hP")
|
||||
local args = {}
|
||||
local fs_info = {}
|
||||
|
||||
-- Format data
|
||||
for line in f:lines() do
|
||||
|
@ -28,15 +28,15 @@ function worker(format)
|
|||
-- Instead match all at once, including network file systems
|
||||
line:match("^[%w/-:%.]+[%s]+([%d%.]+)[%a]?[%s]+([%d%.]+)[%a]?[%s]+([%d%.]+)[%a]?[%s]+([%d]+)%%[%s]+([-/%w]+)$")
|
||||
|
||||
args["{"..mount.." size}"] = size
|
||||
args["{"..mount.." used}"] = used
|
||||
args["{"..mount.." avail}"] = avail
|
||||
args["{"..mount.." usep}"] = usep
|
||||
fs_info["{"..mount.." size}"] = size
|
||||
fs_info["{"..mount.." used}"] = used
|
||||
fs_info["{"..mount.." avail}"] = avail
|
||||
fs_info["{"..mount.." usep}"] = usep
|
||||
end
|
||||
end
|
||||
f:close()
|
||||
|
||||
return args
|
||||
return fs_info
|
||||
end
|
||||
-- }}}
|
||||
|
||||
|
|
Loading…
Reference in New Issue