parent
a13ddc0892
commit
a81435e1be
|
@ -23,11 +23,14 @@ local unit = { ["mb"] = 1024, ["gb"] = 1024^2 }
|
||||||
|
|
||||||
-- {{{ Filesystem widget type
|
-- {{{ Filesystem widget type
|
||||||
local function worker(format, warg)
|
local function worker(format, warg)
|
||||||
-- Fallback to listing local filesystems
|
local cmd = "LC_ALL=C df -kP"
|
||||||
if warg then warg = "" else warg = "-l" end
|
if not warg then
|
||||||
|
-- List only local filesystems by default
|
||||||
|
cmd = cmd .. " -l"
|
||||||
|
end
|
||||||
|
|
||||||
local fs_info = {} -- Get data from df
|
local fs_info = {} -- Get data from df
|
||||||
local f = io.popen("LC_ALL=C df -kP " .. helpers.shellquote(warg))
|
local f = io.popen(cmd)
|
||||||
|
|
||||||
for line in f:lines() do -- Match: (size) (used)(avail)(use%) (mount)
|
for line in f:lines() do -- Match: (size) (used)(avail)(use%) (mount)
|
||||||
local s = string.match(line, "^.-[%s]([%d]+)")
|
local s = string.match(line, "^.-[%s]([%d]+)")
|
||||||
|
|
Loading…
Reference in New Issue