themix-project / themix-gui

Graphical application for generating different color variations of Oomox (Numix-based) theme (GTK2, GTK3, Cinnamon, GNOME, Openbox, Xfwm), Archdroid, Gnome-Color, Numix, Papirus and Suru++ icon themes. Have a hack for HiDPI in gtk2. Its Base16 plugin also allowing a lot of app themes support like Alacritty, Emacs, GTK4, KDE, VIM and many more.
GNU General Public License v3.0
2.11k stars 68 forks source link

How to deal with Materia themes in 2023 (Debian Linux) #473

Closed phpony closed 1 year ago

phpony commented 1 year ago

Ok, so I've spent ~4 hours and finally built my very own Materia theme with Oomox in 2023 under Debain Sid (Bookworm).

There are 3 major problems with both Oomox and Materia theme itself and all of them have workarounds:

  1. Flatpak version does not work with Materia themes. The color builder script requires either inkscape or rendersvg to process svg assets but this dependencies are not stated and therefore satisfied in Flatpak sandbox. There's no easy way to fix this. Deb files are also outdated and have broken deps. So we have to use native scripts from github and provide all deps for it.
  2. The current Inkscape falls into death-loop trying to extract element by its id from Materia's svg assets. Those svg files are pretty funny built with hrefs and stuff so while Inkscape desktop app is able to open and correct the file, it's console tools are unable to properly process the image. So we need to force the use of resvg.
  3. There are some ids in assets.txt files that are not presented in assets(-dark?).svg files. This produces error code from rendersvg tool that stops the execution of whole chain render-asset.sh > render-assets.sh > change_color.sh because of defined set -ueo pipefail in all this scripts and therefore theme folder is not being built. We need to alter the script to ignore resvg errors.

So we do this:

  1. Install all deps for Debian Sid:
$ sudo apt-get install python3-gi python3-gi-cairo libglib2.0-bin libgdk-pixbuf2.0-dev libxml2-utils x11-xserver-utils gir1.2-gtk-3.0 gir1.2-glib-2.0 gir1.2-pango-1.0 gir1.2-gdkpixbuf-2.0 gtk2-engines gtk2-engines-murrine gtk2-engines-pixbuf bash bc sed grep parallel sassc   optipng librsvg2-bin python3-pillow python3-pystache python3-yaml resvg make automake libgtk-3-dev npm
$ sudo npm i -g sass
$ git clone https://github.com/themix-project/oomox.git --recursive
$ cd oomox
  1. Change first 4 lines in plugins/theme_materia/materia-theme/src/gtk-2.0/render-asset.sh with you favorite editor - comment out the pipefail option and disable Inkscape:
#!/usr/bin/env bash
#set -ueo pipefail

FORCE_INKSCAPE=false
  1. Do ./gui.sh thing, create theme based on Materia style and export it. Everything works now!

This is not an issue, more of a guide, because there's seems to be no way or reason to provide PR for flatpak build or materia theme scripts inside this project's repo. But this guide can be mentioned in readme.