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()
.iter()
.map(|c| format!(
r#""{}": {{"name": {:?}, "total": {}, "free": {}}}"#,
.map(|c| {
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_name(),
c.get_total_space(),
c.get_available_space(),
))
total_space,
available_space,
total_space - available_space,
)
})
.join(",")
)
}