Open SuperBo opened 3 years ago
I'm not sure that it's good solution, but you can try to create 2 different modules (one for icon and one for text), e.g. network
and network#text
.
You can wrap your icon in a <span>
and set a background
attribute on it, like this:
"format": "{temperatureC}°C <span background=\"#f00\">{icon}</span>"
which results in:
It's a bit of a hack, since you're now styling from the config file and not the style.css
. But you can nonetheless achieve what you're trying to do.
Btw. something like class="icon"
won't work, because class
is not valid pango markup. See valid attributes here
yeah, thank you all. But I think it's a little hacky. I think waybar should provide us a official way to style icon in style.css.
I agree, I don't think hardcoding the styles for icons in configuration is a viable solution. It would be difficult to allow styling "icons" specifically when you are able to put a fontawesome glyph anywhere in the format string though. It really is a shame pango spans cannot have classes.
"backlight": {
"device": "intel_backlight",
"format": "{icon}",
"tooltip-format": "盛{Percentage}%",
"format-icons": ["", "", "", "", "" ],
"on-scroll-up" : "light -A 1",
"on-scroll-down" : "light -U 1"
},
This is my backlight module, now what should i do to increase the size of icon in format. Kindly help.
Hi @ashish-kus , Try this
"backlight": {
"device": "intel_backlight",
"format": "<span size='9pt'>{icon}</span>",
"tooltip-format": "盛{Percentage}%",
"format-icons": ["", "", "", "", "" ],
"on-scroll-up" : "light -A 1",
"on-scroll-down" : "light -U 1"
},
I try to mimic this theme in way bar https://raw.githubusercontent.com/adi1090x/files/master/polybar-themes/previews/blocks/main.gif.
However, I don't know how to style Icon different versus the text.
Does waybar support this option?