Make GTK+ Apps Look Better Under KDE (plus mini GTK+ rant)

Submitted by jbreland on Mon, 05/03/2010 - 21:01

Anyone that knows me knows that I'm not a fan of GTK+ applications, the GTK+ toolkit itself, or indeed even the entire GNOME desktop. I don't hide this. I love Linux and open source software, but I've always thought GTK+ applications look ugly and feel wrong. I can't even fully explain why I have this averse reaction to GTK+, but I've literally always felt this way for as long as I've used Linux, going back to the Red Hat 6.0 days. Granted, GTK+ has come a long way since then, but I still don't think it can hold a candle to Qt, both in terms of look and feel and attractiveness. This is one of the (admittedly geeky) reasons I've long preferred KDE over GNOME.

(Interesting aside that I just noticed: I think a comparison between between the GTK+/QT and GNOME/KDE websites also says a lot.)

Unfortunately (for me, at least), many of the "best of breed" Linux applications are built on GTK+. I consider Firefox to be the best general purpose web browser, I think Thunderbird (despite some stagnation over the last few years) is still the best e-mail client, Pidgin is the best IM client, GIMP (even though it pains me to say it) is the best image editor, etc. Despite my bias against GTK+, these are great applications that I use every single day.

Running GTK+ applications under KDE, however, can be an unpleasant experience; aside from the whole "feeling wrong" thing mentioned above, they look absolutely horrendous by default. If you use a KDE-based distribution, such as openSUSE, Kubuntu, or Mandriva, the maintainers usually apply special themes to the GTK+ applications to make them fit in better on the KDE desktop. For users of desktop neutral distributions, or even (gasp!) GNOME-based distributions, though, you'll need to do some extra work to spruce up GTK+ applications.

There are several options to do this, but the easiest method I've found is to install a high quality GTK+ theme links against the Oxygen icons and widgets. For a long time I've used QtCurve to do this, which is mature and works very well. More recently I've switched over to Oxygen-Molecule which looks a bit more accurate under KDE 4.4. In either case, once you get the theme setup it'll be very difficult to distinguish GTK+ applications from Qt applications based on appearance alone.

Many distros already include packages for these themes, which makes installation extremely easy. For example, Gentoo names the packages x11-themes/oxygen-molecule and x11-themes/gtk-engines-qtcurve; Arch includes qtcurve-gtk2 in the base repositories, and oxygen-molecule-theme is available as an AUR package. If your distribution doesn't provide a package, you can install the themes manually by downloading them from the previous links; installation instructions are included in the download.

Once the theme is installed, you need to instruct your GTK+ applications to use it. Sadly, this can be tricky if you don't already have GNOME installed, as the KDE control panel only applies themes to KDE and Qt-based applications. The easiest way I've found to do this is to install gtk-chtheme. It's a lightweight theme switcher specifically for GTK+ applications, and should be packaged by most distributions. Run gtk-chtheme after it's installed and you should see a list of available GTK+ themes. Raleigh is the default "horrendous" theme that I described earlier. Assuming Oxygen-Molecule or QtCurve have already been installed, you should also see them in the list. Select the new them and hit OK. You'll need to restart your GTK+ applications for the change to take effect. After that... viola! Enjoy the attractive new look of your GTK+ applications.

A lot more helpful information can be found in the Arch Linux KDE wiki page.