diff options
author | Adrian C. (anrxc) <anrxc@sysphere.org> | 2009-09-24 15:36:49 +0200 |
---|---|---|
committer | Adrian C. (anrxc) <anrxc@sysphere.org> | 2009-09-24 15:36:49 +0200 |
commit | 7dc611585a68f6934c9f417869cfd53b830d9c17 (patch) | |
tree | beab3b0f758b1392679a22bf9e67ee5b8b6d57f1 /fs.lua | |
parent | a54350782e9bbd81aad3ef58a11826e3cd13134c (diff) | |
download | vicious-legacy-7dc611585a68f6934c9f417869cfd53b830d9c17.tar.xz |
Backported 'remote file systems in fs widget are optional'
Diffstat (limited to 'fs.lua')
-rw-r--r-- | fs.lua | 11 |
1 files changed, 6 insertions, 5 deletions
@@ -15,17 +15,18 @@ module("vicious.fs") -- {{{ Filesystem widget type -local function worker(format) +local function worker(format, nfs) + -- Fallback to listing only local file systems + if nfs then nfs = "" else nfs = "--local" end + -- Get data from df - local f = io.popen("LANG=C df -hP") + local f = io.popen("LANG=C df -hP " .. nfs) local fs_info = {} for line in f:lines() do if not line:match("^Filesystem.*") then - -- Format helper can't deal with matrices, so don't setup a - -- table for each mount point, with gmatch local size, used, avail, usep, mount = - -- Instead match all at once, including network file systems + -- Match all at once, including network file systems line:match("^[%w%p]+[%s]+([%d%.]+)[%a]?[%s]+([%d%.]+)[%a]?[%s]+([%d%.]+)[%a]?[%s]+([%d]+)%%[%s]+([%w%p]+)$") fs_info["{"..mount.." size}"] = size |