Details
- Reviewers
cblack ngraham - Group Reviewers
Plasma - Commits
- R99:a5d4ddb3b1a2: [GTK Config] Apply color scheme to GTK3 applications
This is how I got it to work, improvements to the process are appreciated
- Apply D28070
- Compile breeze-gtk and then copy $PREFIX/kde/usr/share/themes/Breeze to /usr/share/themes (replacing the existing Breeze (make a backup)). This is needed because Breeze-Gtk recently changed its color definitions names, which are used in this diff. Old Breeze-Gtk uses different ones and therefore the coloration won't work.
- Run systemsettings and reapply Breeze theme from Application Style KCM
- Restart kded5
- Go to colors KCM, open it side by side with GTK3 applications (preferably Gedit NOT Nautilus or Lutris (those ones are kept open if you press cross in headerbar))
- Change the color scheme.
- The application must change the colorscheme
Diff Detail
- Repository
- R99 KDE Gtk Configuration Tool
- Branch
- set-colors
- Lint
No Linters Available - Unit
No Unit Test Coverage - Build Status
Buildable 23838 Build 23856: arc lint + arc unit
The GTK+ module shouldn't be in this patch, as it and the functions to write CSS are separate changes.
- I should add the recoloration module to autoload with GTK applications
Then how do I test the recoloration? It seems like it applies randomly whenever the GTK app would like to update the colors, but with that module it's predictable. Or do you mean to make it as a separate patch, but make this one depend on it?
The two items don't have a dependency relation codewise. You simply test the recolouration like how it's been up until now—restart the applications.
You simply test the recolouration like how it's been up until now—restart the applications.
It doesn't work. This is what I was talking about:
It seems like it applies randomly whenever the GTK app would like to update the colors, but with that module it's predictable.
You seem to be testing with Nautilus, which doesn't actually close when you press the close button.
Yes, you're right, but I also tested it with Lutris. It also does not work. But with gedit it works fine.
Lutris is also another application that doesn't close fully when you press close (however, that part is configurable in Lutris.)
It seems it is possible to do this (removing stuff from the data engine) after all. I will try to work on this in the next time
Seems I replied to the wrong diff, oops...
Hmm, when following those instructions, I get the following console error:
Gtk-Message: 08:50:13.086: Failed to load module "colorreload-gtk-module"
And the color scheme doesn't change. The colorreload-gtk3-module target did get built, and it installed a shared library to /home/nate/kde/usr/lib64/gtk-3.0/modules/libcolorreload-gtk-module.so
Well this is kind of a problem then since we need to support development builds to a nonstandard install prefix.
Try export GTK_PATH='/home/nate/kde/usr/lib/gtk-3.0/' before launching a GTK app. This should make module to load.
The path would be /home/nate/kde/usr/lib64/gtk-3.0/ on my system, but nonetheless there is no effect. :(
Is the GTK application throwing the same error, that the module is not found, or recoloration does not work?
You can provide a full path to the library instead of letting GTK do name to library resolution.
Does the specified path contain (/home/nate/kde/usr/lib64/gtk-3.0/) modules directory with the libcolorreload-gtk-module.so file?
If there it is, try launching GTK app with:
gtk-app --gtk-module /home/nate/kde/usr/lib64/gtk-3.0/modules/libcolorreload-gtk-module.so
The parameter must be absolute path.
Yes, you can, but that's inconvenient. According to this you can specify GTK_PATH environment variable, so that GTK knows where to search for modules. It works for me at least.
I also noticed a dynamic recoloration bug: it doesn't work if the app is launched with the color scheme, that it was using in the previous launch. To make it work I have to change color scheme and relaunch the app. The app therefore changes its color scheme to a new one and it is now reacting to color scheme change properly (i.e. changes it without restart).
@ngraham Did you manage to load the recoloration module into the GTK app by one or another way?
Still doesn't work for me:
gnome-chess --gtk-module /home/nate/kde/usr/lib64/gtk-3.0/modules/libcolorreload-gtk-module.so Gtk-Message: 08:49:51.962: Failed to load module "colorreload-gtk-module"
Actually the specified module is loaded. The error message comes from the module specified in the settings.ini.
If it weren't the message would be something like this (i.e. mentioning absolute module path):
Gtk-Message: 17:56:18.012: Failed to load module "/home/gikari/kde/usr/lib/gtk-3.0/modules/libcolorreload-gtkd-module.so"
Check the recoloration - does it work?
Still doesn't work:
gnome-chess --gtk-module /home/nate/kde/usr/lib64/gtk-3.0/modules/libcolorreload-gtk-module.so Gtk-Message: 08:49:51.962: Failed to load module "colorreload-gtk-module"
No. :(