sailfishos-patches / patchmanager

Patchmanager for SailfishOS
https://openrepos.net/content/patchmanager/patchmanager
Other
21 stars 22 forks source link

[SFOS 4.6] Support new theme icon location #464

Closed nephros closed 1 month ago

nephros commented 2 months ago

This took me way longer to figure out than should be necessary.

Background: Sailfish OS 4.6 changes the default path for "theme" icons, such as the ones used for Settings plugins (which we are).

Additionally, the layout of the source dir for svgs to convert has changed or the sailfish-svg2png tool.

This drops amost all of src/icons/icons.pro, as that was a verbatim copy of the upstream sailfish-svg2png .prf file, and just uses that prf file as intended.

I haven't checked, but this may mean we lose some of the icon scales for older packages, but it should't realy make a noteworthy difference.

Olf0 commented 2 months ago

Thanks for the fixup. I really start to hate them for doing such breaking changes as altering arbitrary names regularly.

I will try to take a look at it and comprehend what you researched and implemented (I may need this for other projects, too) next weekend.

b100dian commented 1 month ago

Thanks for the quick fix!

nephros commented 1 month ago

I will try to take a look at it and comprehend what you researched and implemented (I may need this for other projects, too) next weekend.

Yes, but only those ones which actually use the /usr/share/themes location. Most packages use /usr/share/icons which is not affected.
On my main system the only non-jolla packages that use the themes location are patchmanager, some I wrote on my own, and some originally written by coderus (like screencast).

find /usr/share/themes/sailfish-default/ -type f |xargs rpm -qf|sort -u

In case you need it, these are the steps:

  1. if a .pro file is used, change it to the four-line version:
    TEMPLATE = aux
    # Configures svg to png
    THEMENAME=sailfish-default
    CONFIG += sailfish-svg2png
  2. in the svgs subfolder, create the subdirs icons and icons-monochrome, and copy or link the original svg image there
  3. adjust the %files path in the .spec to the "many asterisks" variant: %{_datadir}/themes/*/*/z*/*/*.png