Can I align text horizontally in genmon plugin?

Pango Text Attribute Markup Language seems not to support such an attribute. I found an article about tables in Pango that support alignment but can't figure out how and if I can use them in genmon. Simply wrapping the txt body in || || does not have any effect, the bars are displayed as is.

...where "XX" is the plugin designator (hover over the plugin in the Panel Properties, Items tab to get this value). Also note that the "#" at the beginning is not a comment marker but a widget identifier in CSS.

Or if you want to just affect the label element of the plugin only (and not all elements):

Re: Can I align text horizontally in genmon plugin?

bodqhrohro wrote:

Would it accept text-align: center; or margin: 0 auto; rules as well?

Unfortunately no because the GtkLabel widget automatically sizes itself for the space it needs. There is no easy way in GTK3 to specify a fixed size for the widget (or at least that I know of). I guess you could resort to using cairo and canvases to draw the text and images, but that seems overkill for what this plugin was initially designed to do. Right now, the only way to centre it is to pad the sides with spaces (GTK2) or use padding CSS directives (GTK3).

Are you trying to centre varying widths of text output in a pre-defined space? If so, there is an enhancement request for this already.

And does asterisk without preceding space have special meaning in GTK+ implementation of CSS or the space is accidentally omitted?

No that is correct. The "*" right after (no space) the widget designator means that it applies to all sub-widgets as well. The second css snippet option shows how to affect a certain widget within the plugin for the current GTK3 release of the plugin (version 4).

In development in the git tree, I have added some more CSS style classes so you can more easily affect certain elements of the plugin. See: this commit. However, this hasn't yet been released and is still in testing mode.