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

Make text module a label #1331

Closed
memeplex opened this issue Jul 20, 2018 · 4 comments · Fixed by #2676
Closed

Make text module a label #1331

memeplex opened this issue Jul 20, 2018 · 4 comments · Fixed by #2676
Labels
Milestone

Comments

@memeplex
Copy link
Contributor

The text module is too inflexible: it's not possible to set left/right padding, it's not possible to change the font, etc. Why not making it a label with a %text% token by default? This would be much more flexible and also consistent with most of the other modules (consider script, for a similar one).

@memeplex
Copy link
Contributor Author

To be more precise, what I mean is to add an implicit format = <content>. I think this will be easy to implement and mostly backwards compatible without any change of configuration (except for some format properties that will have to be moved from content to format, but the most common properties belong to both labels and formats). It's weird that the text module is almost the only one not doing this.

@memeplex
Copy link
Contributor Author

I've pushed a PR for this. It was a bit more difficult than my previous patches but at the end I think I got it right and now I understand quite more about how polybar works so I believe I could help with another not too complex issues in the future. I would be thankful if you review the change and will try to improve anything non merge-quality ASAP.

@memeplex
Copy link
Contributor Author

memeplex commented Jul 23, 2018

Revisiting the documentation I realized that this could be worked around, although in an admittedly hackish way, by using a format prefix or suffix which are themselves labels. Nevertheless I think having the main content as a label is not only cleaner but also more consistent with the rest of the modules.

@memeplex
Copy link
Contributor Author

TIL about the %{T} tag (#1345) which also ameliorates the need for this refactoring. Still, the other reasons (mainly consistency) still hold.

@patrick96 patrick96 added this to the 4.0.0 milestone Jul 29, 2018
@patrick96 patrick96 added this to In progress in Refactoring Jul 29, 2018
@patrick96 patrick96 removed this from In progress in Refactoring Jul 29, 2018
patrick96 added a commit to patrick96/polybar that referenced this issue Apr 4, 2022
patrick96 added a commit to patrick96/polybar that referenced this issue Apr 4, 2022
patrick96 added a commit to patrick96/polybar that referenced this issue Apr 4, 2022
patrick96 added a commit that referenced this issue Apr 4, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants