bilelmoussaoui / Hardcode-Tray

Fixes Hardcoded tray icons in Linux
Other
859 stars 63 forks source link

Adapt to currently installed Inkscape version #757

Open lsdch opened 1 year ago

lsdch commented 1 year ago

Thanks for this nice tool, I could finally fix the ugly discord icon in my tray bar.

I had some trouble running it at first, and found out that Inkscape was silently failing to convert SVG icons from the theme. This is because my system had Inkscape 1.2.2 whose CLI differs from 0.92, the reference version in the code.

This PR attempts to fix this by parsing inkscape --version to find out whether it is >=1 and adapt system calls accordingly. It also adds .png extension to temporary PNG files, which seems to be required for Inkscape to output anything for some reason. This should be harmless in the general case.

An additional dependency on Python module semantic-version was added, but not included yet in meson.build (could not figure out how to, if it's even possible) or in the README. It could easily be removed if you would rather avoid adding extra dependencies, and just add some code to parse Inkscape's version.