Added used space to EWW_DISK
This commit is contained in:
parent
86dce341ac
commit
5ca6ba03c4
1 changed files with 12 additions and 7 deletions
|
@ -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(",")
|
||||
)
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue