Alexays / Waybar

Highly customizable Wayland bar for Sway and Wlroots based compositors. :v: :tada:
MIT License
5.92k stars 667 forks source link

Allow to use SVG as icons #1330

Open sn3w opened 2 years ago

sn3w commented 2 years ago

Icons like Octicons provide SVG files for setting up icons and I'll love to see Waybar support having SVG set as icons.

Moelf commented 1 year ago

would love to be able to use things like https://heroicons.com/

gutfacehubook commented 1 year ago

Would love to use https://materialdesignicons.com/ in the waybar.

hanckmann commented 1 year ago

Personally I am not interested in additional icon themes, but svg icon support would be a very welcoming addition.

What is required to get svg support in waybar / systray. My issue is mainly the svg icons in the systray which do not show up.

gutfacehubook commented 1 year ago

As workarround i found it is able to load svg as background image: waybar

// waybar config
...
"modules-left": [ "custom/logo", ... ]
...
"custom/logo": {
  "format": "    ",
  "tooltip": false,
  "on-click": "exec lain.sh &"
},
...
/* waybar style.css */
...
#custom-logo {
  background-image: url('/home/lain/.config/waybar/void.svg');
  background-position: center;
  background-repeat: no-repeat;
  background-size: contain; 
}
...

i know this is not the best way to do, but I wanted to share this temporary method I'm using for now.

sandmuel commented 6 months ago

As workarround i found it is able to load svg as background image: waybar

// waybar config
...
"modules-left": [ "custom/logo", ... ]
...
"custom/logo": {
  "format": "    ",
  "tooltip": false,
  "on-click": "exec lain.sh &"
},
...
/* waybar style.css */
...
#custom-logo {
  background-image: url('/home/lain/.config/waybar/void.svg');
  background-position: center;
  background-repeat: no-repeat;
  background-size: contain; 
}
...

i know this is not the best way to do, but I wanted to share this temporary method I'm using for now.

Any way to do something like this on a module with multiple states? (such as the battery module)

5p4r74cu5 commented 6 months ago

I would really like to be able to use svg icons, as doing something like using bitone/duotone icons is possible with fonts as far as I can tell, and it would make a massive difference in customisability.

jlo62 commented 5 months ago

Would love to use https://materialdesignicons.com/ in the waybar.

workaround: Arch AUR has ttf-material-design-icons-git.

Ifaen commented 2 months ago

I assume your workaround of using it as a background image doesn't allow to change it's color right?

jlo62 commented 2 months ago

allow to change it's color right?

Just change the color of the svg with, for example, a text editor or inkscape?

Ifaen commented 2 months ago

allow to change it's color right?

Just change the color of the svg with, for example, a text editor or inkscape? Sorry, I should've added that change the color of the svg dinamically, like with pywal or make the fill attribute usable to allow it being dinamic, but I suppose that's no easy task or limitations of gtk

Lodobo commented 2 months ago

@sfuentesojeda The correct way to do this would be to style the svg icon with CSS, just like you would in a browser.