jnsh / arc-theme

A flat theme with transparent elements (actively maintained fork)
GNU General Public License v3.0
900 stars 77 forks source link

Creating several versions of arc-theme in different colors #149

Closed sometimes-retro closed 3 years ago

sometimes-retro commented 3 years ago

I changed the color tinting of the arc-theme and successfully built a custom version of it using the directions you provided (thank you). The problem is that it won't coexist with the repository version of Arc that already exists on my machine.

I tried renaming the custom version, but then it stopped showing up in the MATE theme chooser. (I tried both renaming the outer folder and renaming the theme inside the index.theme file for GTK3. The result was the same.)

Is there a way to get multiple versions of Arc to coexist? For example, a way to rename it without it breaking? I'd like to create some different colors and compare how they look with full themes that I'm working on (icons+window border+GTK+wallpaper).

Thank you!

Note: I'm on Fedora 33, with the MATE desktop environment, and the latest version of arc-theme available through the git download as of July 25, 2021.

jnsh commented 3 years ago

AFAIK, renaming the base theme directory, and updating every instance of the theme name in index.theme accordingly should be enough, e.g. cp -r Arc/ Arc-new/ && sed -i 's/Arc/Arc-new/g' Arc-new/index.theme

sometimes-retro commented 3 years ago

@jnsh Thank you for your reply! I tried what you mentioned and, for some reason, it didn't work.

I played around with it to try to figure out what the issue was and I finally got it working. Here is a summary of what I did, for anyone that's curious:

Solution Summary

  1. Rename "Arc" and related names in the arc-theme/meson.build file -- this changes the names of folders and the names of the themes in the index.theme files.
  2. Rename "arc-theme" in the arc-theme/common/gtk-3.0/meson.build file, specifically the gresource prefix and resource:/// references -- this makes sure the resource files aren't using the same name as any default installation of Arc, so the custom theme won't conflict with it.

Note: The INSTALL.md file suggested ~/.local/share/themes which did not work on my machine. On my distro (Fedora 33 MATE), the following directories work: /usr/share/themes (system-wide) and ~/.themes (user-specific).

After following the aforementioned steps and putting the custom theme into ~/.themes it works great and I also have access to the default Arc installation that was already on my machine.

jnsh commented 3 years ago
  1. Rename "arc-theme" in the arc-theme/common/gtk-3.0/meson.build file, specifically the gresource prefix and resource:/// references -- this makes sure the resource files aren't using the same name as any default installation of Arc, so the custom theme won't conflict with it.

Hmm.. I can't think of any reason why that would make a difference. All the existing variants use the same resource:// paths, and the generated gtk.gresource files are all variant specific, and should get loaded by GTK3 from the specific theme directories. The actual theme gtk-main*.css files inside the gtk.gresource files have different names between variants, but that shouldn't matter as long as the correct file name is referenced in the <BASE_THEME_DIR>/gtk-3.0/gtk.css.

Note: The INSTALL.md file suggested ~/.local/share/themes which did not work on my machine. On my distro (Fedora 33 MATE), the following directories work: /usr/share/themes (system-wide) and ~/.themes (user-specific).

I did mention in the INSTALL.md that ~/.local/share/themes may not always work, and for that reason suggested symlinking the theme directories from ~/.local/share/themes to ~/.themes, although I only knew this was necessary for the GTK2 theme. If MATE is still using GTK2, I suppose it would make sense that this was necessary for its theme selection thing.

Happy to hear you got it sorted anyway, and thank you for reporting back with your findings :)

sometimes-retro commented 3 years ago

@jnsh I didn't think those alterations would be necessary, either. I don't know whether it's a distro-specific issue or a desktop environment-related issue.

I didn't see that note in the INSTALL.md -- my mistake! I'm glad you included it. MATE appears to have been shifting primarily to GTK3 for some time now. They note in blog posts going back to 2016 that they were building the apps associated with the desktop environment to work primarily with GTK3: https://mate-desktop.org/blog/2016-09-21-mate-1-16-released/ I initially only created a GTK3 build of the custom Arc theme and it applied to every application that I use regularly.

Whatever the cause, I hope my solution helps anyone who encounters this issue in the future, and thank you again for your help. :)