Adding QT Colour Schemes to Kate when running Gnome (or how to get the dark mode back!)

If you've been running QT based applications under Gnome for long enough, it's likely that you'll eventually encounter issues with inconsistent theming and colour schemes when it comes to having QT and/or KDE based applications try to match or inherit parts of the Gnome / GTK theme you're running. Note that this scenario is not specific to Gnome, and you can experience this issue and also fix it the same way on other desktop environments.

A particular example I've encountered occurred when moving from Fedora 32 to 33. The text editor "Kate" no longer uses a dark colour scheme if you've got the supplied "Adwaita-dark" applied to Gnome.

Notice how the outer GUI is white. Previously in Fedora 32 it would match the dark GUI colours used by the "Adwaita-dark" Gnome theme, however this no longer occurs in Fedora 32. Note that the inner editor's "Colour Theme" works fine. It's using "Solarized Dark".

 

There are no issues setting a "Colour Theme" under Kate's "Editor Component" settings - however this only applied to the inner editor. What we want is a theme we can choose under "Settings > Colour Scheme". The only option you'll see is "Default" - at least with Kate under Fedora 33.

We can fix this by installing Kvantum. We actually don't even need to perform any configuration either! Simply installing it will be enough.

sudo dnf install kvantum

Whoa. We now have different "Colour Schemes" to choose from!

 

Now that Kvantum is installed, if you check "Settings > Colour Scheme" inside Kate, you'll see a bunch of different options. "KvGnomeDark" will get you the same dark theme that gets inherited when running Kate under Fedora 32 using the "Adwaita-dark" Gnome theme. There are other nice options too, like "KvAdaptaDark".

It's worth mentioning that Kvantum has more to it than just what has been demonstrated here. Kvantum can be used to "hook" into QT applications and set specific theme/scheme options across QT applications. I'd recommend checking out these YouTube guides below.

This article was updated on October 3, 2021