Gnome Java Swing App - Use the Adwaita Window Title Bar (Dark Skin)

Is there a way for a Java Swing desktop application that runs on Gnome (3.14) on Linux (Debian) so that Gnome uses a dark themed (Adwaita) version of the window design?

I use a custom dark Swing look-and-feel, and the only thing that is really annoying is that the title (native Gnome) is very bright. I already used the Tweak tool to use the whole Adwaita system, but this does not apply to applications that clearly do not support a dark theme (for example, Iceweasel, Icedove, Gimp, Libre Office, ...)


Here is a screenshot that illustrates the problem:

enter image description here

+8
java swing gtk3 gnome-3
source share
1 answer

Well, I found a viable solution for my specific system, so I will show what I did here. This is related to this issue . In the accepted answer, you see that the problem is related to legacy Gtk-2 applications, and this seems to include Java. The comment section has a link to Adwaita-Dark clone , which also applies the dark theme to Gtk-2.

Unfortunately, this theme is not synchronized with Debian Jessie / Gnome 3.14, and if you install this theme, most widgets are broken into Iceweasel, Icedove, etc. But. Since I do not care about widgets, but only in the window title bar here, you can selectively use this clone only for window decoration.

So, I downloaded this clone and placed a symlink in ~/.local/share/themes/adwaita-again (here you can use any name). Then, in the Tweak tool, just flip the window style, for example:

enter image description here

And voilà, the title bar of the window title is dark for all applications:

enter image description here

This is also great with IntelliJ IDEA and the Darcula theme. Linux FTW.


Change It seems that the above approach does not work fully, at least after a reboot. I see bright colors again. Now I have found a simpler option: copy the original Adwaita theme and fix the Metacity file. I created a repository with my patched version.

+4
source share

All Articles