Macchina-CLI / macchina

A system information frontend with an emphasis on performance.
https://crates.io/crates/macchina
MIT License
1.41k stars 51 forks source link

Accept disk path(s) to display usage of specified disk / multiple disks #286

Closed Rolv-Apneseth closed 17 hours ago

Rolv-Apneseth commented 1 year ago

I have most of the code for this feature done, but I'll wait for the libmacchina crate to be updated to 8.0.0 so it can accept the paths.

My current approach is to add a new option called disks which can be used like this in the config:

disks = ["/", "/home/user"]

Or like this as an argument:

--disks '/,/home/user/'

Note that the show option of DiskSpace would still be required, as otherwise disks won't do anything. I did it this way to avoid a rewrite of how the show values are currently handled. The other way I thought of doing this was making show into an array of tables but that seems overly complicated and it's a breaking change to everyone's configs. What do you think of the approach I took / did I maybe miss a simpler approach?

Rolv-Apneseth commented 2 weeks ago

Checked it out again briefly and - did the code from Macchina-CLI/libmacchina#156 get reverted? I would need that, or something like that, for this feature as otherwise / is hard coded. I believe that's why I mentioned here about waiting for 8.0.0 as that was a breaking change

Edit: forgot to ping in case you're not subscribed, @grtcdr

grtcdr commented 2 weeks ago

It wasn't reverted, I think I just moved the v8 stuff to its own branch, 8.0.0. We will eventually merge 8.0.0 onto master again, would you mind working against that branch?

Rolv-Apneseth commented 2 weeks ago

Ah, I see, my bad. Yes I can do that