mako icon indicating copy to clipboard operation
mako copied to clipboard

Scalable icons are not used

Open alkar opened this issue 3 years ago • 5 comments

In my mako config I have:

icon-path=/usr/share/icons/elementary

When I send a notification with "newsboat" as the icon, it doesn't show any icons, although I have the following in my filesystem:

/usr/share/icons/hicolor/scalable/apps/newsboat.svg

If I supply the full path, it works, of course.

Reading through the code I believe that icons in the scalable folder are going to be ignored completely because this will produce an error and will cause the loop to move on to the next icon found.

I wonder if it would make sense for icons found in the scalable folder to take precedence over others (since they should be able to scale to any desired size) or at least, be accepted as appropriate as soon as the loop finds one.

alkar avatar Sep 19 '21 07:09 alkar

We should lookup icons according to the spec: https://specifications.freedesktop.org/icon-theme-spec/icon-theme-spec-latest.html

emersion avatar Sep 19 '21 07:09 emersion

Given that,

man 5 mako mentions:

       /usr/share/icons/hicolor and /usr/share/pixmaps are always searched.

And the spec mentions:

The lookup inside a theme is done in three phases. First all the directories are scanned for an exact match, e.g. one where the allowed size of the icon files match what was looked up. Then all the directories are scanned for any icon that matches the name. If that fails we finally fall back on unthemed icons. If we fail to find any icon at all it is up to the application to pick a good fallback, as the correct choice depends on the context.

And on my system I only have a single "newsboat" icon:

$ find /usr/share/icons/ -name '*newsboat*'
/usr/share/icons/hicolor/scalable/apps/newsboat.svg

Would it be unreasonable to expect mako to select it, eventually?

I'll need to read the pseudocode in the spec a bit more carefully and compare to the mako implementation but at a glance it looks like it's not doing the second pass (also see this comment).

alkar avatar Sep 19 '21 08:09 alkar

I can confirm that the current implementation is not anywhere near complete, it probably needs to be redone by someone who has more than one icon theme installed. -_-;

vilhalmer avatar Sep 19 '21 13:09 vilhalmer

I'm not 100% sure this is related, but I'm seeing something similar. In the Adwaita icon set, there's a symbolic/devices/drive-removable-media-symbolic.svg and scalable/devices/drive-removable-media.svg. I have the Adwaita directory added to icon-path and mako recognizes the symbolic version, but not the scalable one.

jmcantrell avatar Sep 15 '23 00:09 jmcantrell

Can confirm, I tried to set it to the BeautyLine or the candy-icons theme, both of which only have scalable icons afaik. The icons do not get applied. The icons work with dunst, but on the other hand only mako supports transparency/opacity on wayland.

githubkuyaya avatar Jan 16 '24 17:01 githubkuyaya