'Can we set themes in GTK 3 for Windows?

In Ubuntu, installing themes are as easy as copy-pasting GTK theme into the themes folder, then with the tweaks tool we can select the theme.

I couldn't find a working solution or workaround to apply themes.

Steps I have tried:

  1. Installing the runtime The GTK runtime I am using is https://github.com/tschoonj/GTK-for-Windows-Runtime-Environment-Installer/releases.
  2. Get a theme from https://www.pling.com/p/1246387/
  3. Extract the content to C:\Users\username\AppData\Local\Gtk\3.24.24\share\themes
  4. Edit settings.ini on C:\Users\Seiko Santana\AppData\Local\Gtk\3.24.24\etc\gtk-3.0\settings.ini putting gtk-theme-name=Ultimate-Dark-(Cpt)-Violet
  5. Run any GtkSharp application.

It is still loading Adwaita theme. Did I miss something? I'm developing on .NET 6 and GtkSharp if that matters. Thanks in advance.



Solution 1:[1]

I put the theme file under the themes directory like so:

enter image description here

, and added the following code right after Init (if I put it before that, it causes a null exception).

    public static void Main(string[] args)
    {
        Application.Init();
        Gtk.Settings.Default.ThemeName = "Ultimate-Dark-(Flat)-Violet";   

and it worked:

enter image description here

Without that line, the default theme is like this, so it definitely worked.

enter image description here

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Damn Vegetables