I'd like to achieve something I thought would take a couple of seconds and turns out to be a nervous breakdown: override a theme's selected item color in a GTK3 theme.

At first, I naively though that overriding the value in ~/.config/gtk-3.0/gtk.css would to the trick, but no, it is ignored.

$ cat ~/.config/gtk-3.0/gtk.css
@define-color selected_bg_color #ff4e9a;

I then rsync'ed /usr/share/themes/<name> to ~/.themes and changed the wanted color in there by modifying the value of selected_bg_color, but that did nothing.  I sed'ed all the color values in the css file. Still ignored.

Finally, the only way I found to override one simple color was to "register" the local copied theme:

cd /home/foo/.themes/themename/gtk-3.0
glib-compile-resources gtk.gresource.xml

Is GTK3 so overengineered that there's no other way to override a color?

Edit: before anybody advise to launch gnome's Appearance menu, I'm running Mate Desktop, where preferences apply to GTK2.
Also gtk-theme-config does strictly nothing apart from filling ~/.config/gtk-3.0/gtk.css.

  • 1
    have you tried editing org.gnome.desktop.interface.gtk-colorscheme using dconf and setup selected_bg_color:#ff4e9a as value? – zmo May 19 '17 at 14:46
  • Strangely this value is already set to the color, possibly meaning that it actually reads this gtk.css file, but does really nothing with it... – iMil May 20 '17 at 11:01
  • 1
    You can try installing gtkparasite and launch apps using GTK_MODULES=gtkparasite any-gnome-crap to try to reverse the 💩 that's going on in there. – zmo May 20 '17 at 12:03
  • Does your theme use selected_bg_color at all? – L. Levrel Nov 6 '18 at 11:02

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.