2

Recently I learned that adding css styles to ~/.config/gtk-3.0/gtk.css can do some tricks to the visual appearance of gtk-3.0 based applications. Yet restarting the application after each change while trying to find the best settings is quite cumbersome.

When switching themes, the application immediately changes to the new theme, but it seems to ignore changes to gtk.css. Is there a way to have it reload that file too?

  • Are you programming in C? – WinEunuuchs2Unix Nov 4 '18 at 16:26
  • 1999, roughly was the last time I programmed in C :-) Why are you asking? – Harald Nov 4 '18 at 20:49
  • If I change the color in * { caret-color: #000000; } in ~/.config/gtk-3.0/gtk.css, all I need to do is to save the file. After that, if I open a compliant application such as mousepad, the text editor in Xubuntu, the edit is effective. This is without changing the gtk3 theme. (By compliant, I mean applications that don't set their own caret color.) – DK Bose Nov 7 '18 at 11:58
  • @DKBose OP was specifically asking about not having to restart the application. – Tobia Jul 5 '19 at 18:27
1

When I tweak ~/.config/gtk-3.0/gtk.css and reload the theme I instantly see the result, so at least the GTK applications that matter to me instantly pick up the changes. (I'm not sure what a GTK app needs to do to subscribe to theme changes, but that may be behind WinEunuuchs2Unix's question.)

To make my life easier when tweaking gtk.css, I'm using Ikbel's bash function reload_gtk_theme (see https://askubuntu.com/a/1110354/304643). It basically saves, clears and restores your GTK theme using gsettings.

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.