dunst-project / dunst

Lightweight and customizable notification daemon
https://dunst-project.org
Other
4.52k stars 338 forks source link

Allow customization of SVG fill color #1076

Open UtkarshVerma opened 2 years ago

UtkarshVerma commented 2 years ago

Issue description

I use solid SVG icons for my notifications like those from FontAwesome. I wish to have the SVG colored according to the foreground colour defined in dunstrc as well.

image

Currently, the icon is displayed in black while the text is coloured.

Installation info

fwsmit commented 2 years ago

Do you know how this could be achieved?

UtkarshVerma commented 2 years ago

I don't know how dunst works, but the way I was thinking of implementing this was editing all my SVG icons so that they point to the color currentColor instead of a specific value.

Therefore, <svg fill="currentColor" ...>...</svg> would do the job. This doesn't work because the SVG render doesn't take this currentColor into account. If we could have the SVG renderer define currentColor equal to the foreground color, that would be enough.

fwsmit commented 2 years ago

Yeah I'm not sure if the svg renderer we use supports setting colours.

UtkarshVerma commented 2 years ago

Yeah I'm not sure if the svg renderer we use supports setting colours.

What if we handle SVGs differently? We can parse SVGs as plain text, do a simple string substitution for "currentColor" -> "foreground", and then pass this modified string to the renderer?

HashirGJ8842 commented 6 months ago

What is the status of this feature? Can i look into it?

fwsmit commented 6 months ago

There was a PR, #1081, but it wasn't finished. Feel free to look into in and perhaps continue the PR. You can also start a new one if you like

HashirGJ8842 commented 6 months ago

Okay, thanks 👍

bynect commented 4 months ago

Note: I liked the implementation of #1081, but I think that it is better to implement a more general solution like svg_style for including a stylesheet string into the svg (for more adhoc styles)