Waybar icon indicating copy to clipboard operation
Waybar copied to clipboard

Add justify config option for Labels

Open dann-merlin opened this issue 1 year ago • 3 comments

This is PR adds the option to specify a "justify" field for aligning text modules. It should be either "left", "right" or "center".

This is especially useful for centering the text in labels on vertical bars. In situations like this:

"format": "{icon}\n{value}%", This kind of fix was already mentioned in #366, however it was never implemented, so here's my take on it.

An example config for this:

    "memory": {
        "format": "\n{}%", // That's a character for a RAM module in the font I'm using.
        "justify": "center",
    },

dann-merlin avatar Feb 05 '24 14:02 dann-merlin

Nice, can you add this to the man and github wiki?

Alexays avatar Feb 06 '24 15:02 Alexays

This would need to be added to basically all module documentations, right?

dann-merlin avatar Feb 06 '24 16:02 dann-merlin

Would love to see this implemented, I myself have been wanting this!

2hexed avatar Feb 14 '24 09:02 2hexed

Sorry for the delay, yep should be added to all modules that inherit label class :)

Alexays avatar Feb 19 '24 21:02 Alexays

So all we need is documentation for this to get merged?

machitgarha avatar Feb 24 '24 17:02 machitgarha

Alright, I've added documentation for justify whereever I was able to find documentation for align. Which should be everything that inherits the label class. I also slightly changed the documentation for align, in order to clarify the difference between these two options.

Let me know if there's anything else!

dann-merlin avatar Mar 04 '24 19:03 dann-merlin

LGTM, thx!

Alexays avatar Mar 05 '24 08:03 Alexays