You are not logged in.

#1 2020-05-29 04:33:52

PyroAVR
Member
From: Rochester, NY
Registered: 2020-05-29
Posts: 3
Website

Override gsettings for GTK+ themes

I've been pondering this for a while now, and after doing some research I can't find an answer for "how" or "why" to override gsettings.  I read up on gsettings and on GTK+3.0 theme settings, and in neither set of documentation can I find a way in which to specifically override gsettings.

I was recently trying to install a GTK+ theme (arc-gtk-theme) and I was unable to make the theme apply when using $HOME/.config/gtk-3.0/settings.ini, but upon reading the Archwiki GTK+ page (https://wiki.archlinux.org/index.php/GTK#Configuration), I tried using gsettings and it was successful.

Clearly, gsettings appears to be the default place for GTK+3.0 applications to get their theme configuration.  I tested with pcmanfm as my reference GTK+-based application.  Is there any way to override this so that I can have a repeatable configuration that I can move between systems/store in an image, and is there a reason why I should or should not do this?

Input appreciated! I'm using sway and wlroots in the main Arch distribution, if that makes any difference to folks who want to test.

Offline

#2 2020-05-29 06:43:02

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 21,429

Re: Override gsettings for GTK+ themes

The settings.ini should also be picked up as far as I know (at least it does on X11) but only on application restart. Did you do that?

Even so, why do you not just keep a list of gsettings invocations to get the effect you want, and execute that whenever you move/change systems? There technically is a database file, but swapping the entire file out under an active system is probably not the best idea.

FWIW I found the following with a few other approaches: https://askubuntu.com/questions/984205/ … -in-a-file

Last edited by V1del (2020-05-29 06:52:07)

Online

#3 2020-05-29 22:24:10

PyroAVR
Member
From: Rochester, NY
Registered: 2020-05-29
Posts: 3
Website

Re: Override gsettings for GTK+ themes

I forgot to mention that I did restart pcmanfm after every change to the settings.ini file or invocation of gsettings.  Interestingly enough, gtk-application-prefer-dark-theme = true is picked up in settings.ini, but gtk-theme-name = Arc-Dark is not picked up, and must be set with gsettings.

I did some more testing, and removed $HOME/.config/dconf/user, hoping that the lack of a gsettings database would force GTK applications to fall back onto settings.ini.  That change had no effect, strangely.  GTK applications do pick up on unrecognized keys and incorrect syntax in settings.ini, so it's certainly being read, but the key gtk-theme-name is ignored.

I tried using the directory name (/usr/share/themes/Arc-Dark) as well as the name= property in gtk.css for each theme, again with no results.

Lastly, if I remove the gsettings database after having set the theme to something other than the default Adwaita, test that it works, and then remove the dconf database, applications revert back to Adwaita. It appears that keys in settings.ini are ignored? Is there a system-wide gsettings database that could be overriding it?

Edit: I should mention I checked the askubuntu link, and tried dumping the gsettings database, and tried its keynames in settings.ini, to no avail, though that is the behavior I would expect given they are different configuration methods.

Last edited by PyroAVR (2020-05-29 22:25:17)

Offline

Board footer

Powered by FluxBB