Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature request] add an option to display the value #18

Open
ArthurBais opened this issue Jul 23, 2020 · 6 comments
Open

[Feature request] add an option to display the value #18

ArthurBais opened this issue Jul 23, 2020 · 6 comments
Labels
enhancement New feature or request

Comments

@ArthurBais
Copy link

No description provided.

@florentc
Copy link
Owner

Hello,
Could you please detail your feature request a bit more? Do you mean displaying a textual representation of a value above or next to the bar?

@ArthurBais
Copy link
Author

Hello,
Could you please detail your feature request a bit more? Do you mean displaying a textual representation of a value above or next to the bar?

sorry, it didn't post the description for some reason...

Yeah, I meant that I'd like to see the value because right now it's just printing it out to the terminal.

@florentc florentc added the enhancement New feature or request label Jul 24, 2020
@florentc
Copy link
Owner

I see. Xlib has basic text rendering features, it might not overcomplicate the codebase. Although I am not particularly in favor of it, if there really is demand for such a feature then I will gladly merge a pull request that implements it and assist whoever wants to give it a go. Note there would be details to specify beforehand such as:

  • What would actually be displayed. Currently you choose a total number of subdivisions (by default 100) which is the granularity of the bar, and the values you feed to xob are how many of these units you want filled. In some advanced cases (e.g. high granularity or when an empty bar is not intended to mean 0) this raw value might not be what you would have liked to display. xob is about displaying a bar with no regards to the meaning the user intends to convey.
  • Where and how to display it. Above the bar? Next to it? Which size? How to manage size and position depending on the required length of text.
  • How it would all affect how you configure positions and sizes.

I think we should first gather additional user input on the matter.

@AlecsFerra
Copy link

I'm working on it any suggestion on how the text should be placed?
ex

@MuhammedZakir
Copy link

I'm working on it any suggestion on how the text should be placed?
![ex](https://camo.githubusercontent.com/118d8f27306372be7d62b7f477905b700578fefb2fe3db6b0d1e976d370a51cb/68747470733a2f2f692e696d6775722e636f6d2f474f723867676c2e706e67)

Can the position be configured? If not, I am okay with placing it on the right side.

@florentc
Copy link
Owner

florentc commented Jul 18, 2021

This is quite an undertaking! Managing the position, size, orientation, and color depending on how much of the bar is filled up, the troll cases when inputing a ridiculously high overflow value, etc.

I don't know if this may be useful to you but I plan to merge the tranparency pull request and have libxrender as an additional dependency. Maybe it has some convenient features for text rendering. Consider xrender as an available library to you.
EDIT The feature has been merged and libxrender is now an optional dependency of xob.

Remember that any kind of value can be displayed in the bar. The input value is about how many subdivisions are to be filled up among a maximum (by default 100 but it could be 1000000). For example there could be a bar for screen color temperature with raw values from 0 to 3000 that represent actual screen temperatures from 3500K to 6500K. There is no actual way to know what the user actually displays.

Feel free to experiment and change things if you need to (e.g. displaying the text outside the bar on the left or right or in a dedicated cell if you want to avoid having to manage text visibility when the bar is almost full).

Thank you for your work on this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants