enhancement - highlighting drives close to full
daniejstriata opened this issue · 9 comments
Could you prettify the drives that is close to being full?
What could make this tricky is that 1% on a 10TB volume still has a lot of free space whereas 1% on a 500Mb boot volume, not so much. I'm sure if the logic takes in consideration the actual free space and the total size of the volume (MB,GB,TB) it would be possible to bold the lines with problems on the horizon.
Is it possible to detect if the terminal has capability for rich fonts available and utilise that?
I don't think there's any detection to do before trying to use bold. But I'm rather doubtful about the utility of this feature.
I let the issue open, so that other people can give their opinion.
may be the free column could be red if the free space is below like 5%
so its not necessary to detect if bold is avaible
Taking cue from similar tools and improving upon it:
Add user-configurable:
-
free bytes
warning and critical thresholds -
free %
warning and critical thresholds -
Optional identifier(s) to accompany the above, to solve not alerting for 400MB free on a 500MB device vs not-alerting for 80GB free on 8TB device, allow defining the threshold multiple times based on identifiers.
-
Identifier unset[lowest prio] -> Apply to all devices
-
device_size_total <= xxxGB [mid prio, sort prio appropriately in case it is defined for more than just one size] -> Apply to devices that have this size or lower.
-
device_UUID [top prio]
-
i.e.
bytes: '300MB,200MB,1GB' # Any FS with size 1GB or less warns at 300MB, crits at 200MB
bytes: '50GB,20GB,1TB' # Any FS with size 1TB or less warns at 50GB, crits at 20GB
bytes: '100GB,50GB' # Any other FS warns at 100GB, crits at 50GB
pc: '50,75,68162789-efaf-4744-a719-43ce7da5d445' # My special snowflake device warns at 50% used, crits at 75%
pc: '80,90,1GB' # Devices of 1GB or less warn at 80%, crit at 90%
pc: '90,95' # All other devices warn at 90%, crit at 95%
Change the color bar a little, taking hints from dfrs.
Have a state(1) for the entire use bar then overlay it with used space under thresholds(2) then with used space in warning treshold(3) then used space in critical threshold(4).
I would welcome if the use bar could be a bit bigger, possibly configurable. Maybe the XX% number could be INSIDE the use bar to save space?
Unsure if that would look good or would even display properly.
(not saying your comments aren't relevant) the reason dysk's use bar is shorter is that it's pixel precise while it's only character precise in other tools.
I had no clue, that's neat.
Could have compact
, medium
, big
sizes, being 1x
, 2x
, 4x
(or something akin to that) of the current size, keeping the precision without reworking much code I imagine.
Passing the bar width in parameter would be trivial, like --bar-width 40
, but do we want a parameter just for that ?
My opinion on the size of the use bar might change if threshold colors are implemented, so I would perhaps leave that for a later, separate issue, if that's something you're considering.
Well, we need 4 states for my suggestion, how about keeping the current orange as warning, current green as space-used below warning, and current green in shrunk, maybe dot, form as free space.
Which would only leave needing adding a critical color, which could naturally be a darker shade of the warning one, i.e. some kind of red.
That would keep the current color scheme while adding red into the mix.
I am effectively suggesting to do something similar to dfrs, but with color scheme/precision of dysk, + an additional darker shade for critical state.