Added used space to EWW_DISK

This commit is contained in:
druskus20 2021-08-23 00:06:45 +02:00
parent 86dce341ac
commit 5ca6ba03c4

View file

@ -15,13 +15,18 @@ pub fn get_disks() -> String {
"{{ {} }}", "{{ {} }}",
c.get_disks() c.get_disks()
.iter() .iter()
.map(|c| format!( .map(|c| {
r#""{}": {{"name": {:?}, "total": {}, "free": {}}}"#, let total_space = c.get_total_space();
let available_space = c.get_available_space();
format!(
r#""{}": {{"name": {:?}, "total": {}, "free": {}, "used": {}}}"#,
c.get_mount_point().display(), c.get_mount_point().display(),
c.get_name(), c.get_name(),
c.get_total_space(), total_space,
c.get_available_space(), available_space,
)) total_space - available_space,
)
})
.join(",") .join(",")
) )
} }