sardemff7 / j4status

Status line generator
https://sardemff7.github.io/j4status/
GNU General Public License v3.0
47 stars 9 forks source link

Representation of numeric values as a range of characters #11

Closed flying-sheep closed 6 years ago

flying-sheep commented 10 years ago

Other similar projects allow to interpolate on a given list to display something.

What i mean is that given e.g. an interpolation list of [" ", "▁", "▂", "▃", "▄", "▅", "▆", "▇", "█"], one can interpolate a numeric value (e.g. between 0 and 100, or 0 and 1) on this list.

This could be used in formatting or for labels (if used for labels, there has to be a concept of a “main number” that can be used for interpolation, e.g. hours÷12 for time, signal strength for wifi, volume, charge, …)

sardemff7 commented 10 years ago

I would not use that on labels. This is clearly a value, not a label, because a label is an identifier, it does not change. But this is a really interesting idea to provide in values. Due to the underlying “format string” system I am using, this would be interesting for some other projects as well, so I will definitely implement that some day.

sardemff7 commented 6 years ago

As promised, this feature now exists. It's not pushed yet but it's a matter of days, as the main code is working already.

flying-sheep commented 6 years ago

Very cool, thank you!

sardemff7 commented 6 years ago

And here it is, commit e25d9a653f13802549ed2a5f356b812ad670f873! Enjoy :-)

sardemff7 commented 6 years ago

FTR: the syntax is ${signal:[;0;100; ;▁;▂;▃;▄;▅;▆;▇;█]}