diff options
author | Adrian C. (anrxc) <anrxc@sysphere.org> | 2010-03-10 01:57:25 +0100 |
---|---|---|
committer | Adrian C. (anrxc) <anrxc@sysphere.org> | 2010-03-10 01:57:25 +0100 |
commit | abacd771bd3a2398aa482e1f2ad99fa74ca1582d (patch) | |
tree | f5c516a3d3e880e29c21792241a5c2a3b836529b | |
parent | 94e7ed1beb1a69e896e322ed3c726a91ee60d88b (diff) | |
download | vicious-legacy-abacd771bd3a2398aa482e1f2ad99fa74ca1582d.tar.xz |
fs: include available space in percent, requested by Jon
Format string and key example: "${/home avail_p}"
-rw-r--r-- | README | 2 | ||||
-rw-r--r-- | fs.lua | 4 |
2 files changed, 4 insertions, 2 deletions
@@ -217,7 +217,7 @@ vicious.widgets.fs systems, only local file systems are included by default - returns a table with string keys, using mount points as a base: {/ size_mb}, {/ size_gb}, {/ used_mb}, {/ used_gb}, {/ used_p}, - {/ avail_mb}, {/ avail_gb}, {/home size_mb} etc. + {/ avail_mb}, {/ avail_gb}, {/ avail_p}, {/home size_mb} etc. vicious.widgets.dio - provides I/O statistics for requested storage devices @@ -38,7 +38,9 @@ local function worker(format, nfs) helpers.uformat(fs_info, m .. " size", s, unit) helpers.uformat(fs_info, m .. " used", u, unit) helpers.uformat(fs_info, m .. " avail", a, unit) - fs_info["{" .. m .. " used_p}"] = tonumber(p) + + fs_info["{" .. m .. " used_p}"] = tonumber(p) + fs_info["{" .. m .. " avail_p}"] = 100 - tonumber(p) end end f:close() |