Removed a few filesystem types from lain fs widget
This commit is contained in:
parent
08fb332a69
commit
1685f54115
@ -84,9 +84,13 @@ local function factory(args)
|
|||||||
|
|
||||||
local notifypaths = {}
|
local notifypaths = {}
|
||||||
for _, mount in ipairs(Gio.unix_mounts_get()) do
|
for _, mount in ipairs(Gio.unix_mounts_get()) do
|
||||||
local path = Gio.unix_mount_get_mount_path(mount)
|
local info, path
|
||||||
|
local fs_ty = Gio.unix_mount_get_fs_type(mount)
|
||||||
|
if fs_ty ~= 'autofs' and fs_ty ~= 'efivarfs' and fs_ty ~= 'tmpfs' then
|
||||||
|
path = Gio.unix_mount_get_mount_path(mount)
|
||||||
local root = Gio.File.new_for_path(path)
|
local root = Gio.File.new_for_path(path)
|
||||||
local info = root:query_filesystem_info(query)
|
info = root:query_filesystem_info(query)
|
||||||
|
end
|
||||||
|
|
||||||
if info then
|
if info then
|
||||||
local size = info:get_attribute_uint64(query_size)
|
local size = info:get_attribute_uint64(query_size)
|
||||||
@ -94,7 +98,7 @@ local function factory(args)
|
|||||||
local free = info:get_attribute_uint64(query_free)
|
local free = info:get_attribute_uint64(query_free)
|
||||||
|
|
||||||
if size > 0 then
|
if size > 0 then
|
||||||
local units = math.floor(math.log(size) / math.log(1024))
|
local units = math.floor(math.log(size / 5) / math.log(1024))
|
||||||
|
|
||||||
fs_now[path] = {
|
fs_now[path] = {
|
||||||
units = fs.units[units],
|
units = fs.units[units],
|
||||||
@ -131,9 +135,9 @@ local function factory(args)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
local fmt = '%-' .. tostring(pathlen) .. 's %4s\t%6s\t%6s\n'
|
local fmt = '%-' .. tostring(pathlen) .. 's %4s\t%7s\t%7s\n'
|
||||||
local notifytable = { [1] = string.format(fmt, 'path', 'used', 'free', 'size') }
|
local notifytable = { [1] = string.format(fmt, 'path', 'used', 'free', 'size') }
|
||||||
fmt = '\n%-' .. tostring(pathlen) .. 's %3s%%\t%6.2f\t%6.2f %s'
|
fmt = '\n%-' .. tostring(pathlen) .. 's %3s%%\t%7.2f\t%7.2f %s'
|
||||||
for _, path in ipairs(notifypaths) do
|
for _, path in ipairs(notifypaths) do
|
||||||
notifytable[#notifytable + 1] = string.format(
|
notifytable[#notifytable + 1] = string.format(
|
||||||
fmt,
|
fmt,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user