i3status-rust
i3status-rust copied to clipboard
feature_request(memory): treat `swap_used` zero value as `false` in conditions
Problem
Formatting doc says (if I understand it correctly) that we can write conditions like Percentage: $percentage|nothing here.
I would like to make memory block hidden when swap_used is zero, so I'm trying format = "$swap_used|nothing" but it shows "0B".
Possible solutions
- Maybe hack
swap_usedso zero value will fallback to category "missing placeholder"? - Add formatter option for type Number, like
ignore_zeroorignore_threshold. This is more general approach.
Add formatter option for type Number, like ignore_zero or ignore_threshold. This is more general approach.
I like this. Or even add an option to .eng formatter. Maybe .eng(allow:1..100) or something.
Maybe .eng(allow:1..100) or something.
So the above came up as a potential solution for #1768 as well. Usecase being: showing disk usage, memory usage and other blocks conditionally. Should we rephrase this issue a little broader to encompass that? Or maybe create a new issue that specifically mentions the creation of an (allow:1..100) formatter?