As [Feature Request] Adhere to system theme. · Issue #7548 · sp614x/optifine · GitHub explains, OptiFine Download (a graphical fidelity modification for Minecraft)'s GUI does not by default adhere to the theme of the system. I expected that this was an issue with it, although have wonderfully been corrected at [Feature Request] Adhere to system theme. · Issue #7548 · sp614x/optifine · GitHub
Recently, while troubleshooting another Java application with theming issues (this is not at all unique to OptiFine) I created a fix for this issue. Add
export _JAVA_OPTIONS="-Dswing.defaultlaf=com.sun.java.swing.plaf.gtk.GTKLookAndFeel -Dswing.crossplatformlaf=com.sun.java.swing.plaf.gtk.GTKLookAndFeel -Dawt.useSystemAAFontSettings=on -Dswing.aatext=true"
to your
~/.xprofile
or another location that will allow the variable to be inherited by all processes in your desktop session. Your desktop’s application autostart feature may work, but if it has a dedicated place to set environment variables (for KDE, Session Environment Variables - KDE UserBase Wiki in the docs) use that. For Qt-centric desktop environments like KDE Plasma you may need to additionally set up a GTK theme.
This method obviously uses the GTK compatibility autoconfigurator, so although the colouration is correct, the elements themselves do not adhere to the Breeze application style (the usual disadvantages). However, it’s been a significant improvement to the Java GUIs I occasionally use.
I think this should be upstreamed, but perhaps KDE could implement this in some manner. Regardless, I’ve shared this here to inform those who do not yet know.
By the way, in case you want to test this for yourself and don’t find executing .jar
s intuitive, just adhere to command line - How can I execute a .jar file from the terminal - Ask Ubuntu and set a preset via Dolphin’s file extension to application associator.