HowtosHome > howto documents > desktop > kde and gtk in harmony
 

kde and gtk in harmony

howto make kde and gtk applications look the same

A common complaint by desktop linux detractors is that there is no "consistency" between gtk and qt/kde based applications. While I think this kind of complaint is bunkum, it is in fact possible to make gtk and kde applications look consistent, in any event. There are two avenues you can go down. Both have their advantages and disadvantages.

gtk-qt theme engine

The gtk-qt theme engine is a gtk theme engine that emulates the current qt widget style within gtk based applications. You can download an autopackage package from here. I haven't used autopackage, so can't comment on how well installing it that way will work, however, most distros include the gtk-qt engine in their repositories (I know *ubuntu and gentoo do).

Once installed, you should have an entry for GTK Styles and Fonts under the Appearance & Themes section in the kcontrol application. You will then get a dialog that looks like this:

Set the Use my KDE style in GTK applications and Use my KDE fonts in GTK applications radio buttons, and you'll get consistent looking widgets and fonts between kde and gtk applications.

Like this:

qtcurve

qtcurve takes a different approach. It is a theme that contains a native themeing engine for both gtk and kde. It is extremely configurable and therefore very flexible in its appearance.

A lot of distros have packages for it. There are *ubuntu packages in this repository:

  • # Treviño’s Ubuntu edgy Repository (GPG key: 81836EBF - DD800CD9)
  • # Many "random" software: aMule, amsn, mplayer, moto4lin, flashplugin & flashplayer (9.x)…
  • # Further informations: http://3v1n0.tuxfamily.org
  • deb http://download.tuxfamily.org/3v1deb edgy 3v1n0
  • deb-src http://download.tuxfamily.org/3v1deb edgy 3v1n0

Add these lines to your /etc/apt/sources.list, do a sudo aptitude update and then a sudo aptitude install qtcurve. If your distro doesn't have packages, then you'll need to compile the package from source.

Once installed, it should be available to you in the Styles entry under Appearance & Themes in kcontrol. Set it as the default style, configure it to your liking, and you'll have qtcurve going in kde.

To get it going with gtk applications, edit your ~/.gtkrc-2.0 file to look like this:

  • include "/usr/share/themes/QtCurve/gtk-2.0/gtkrc"
  • style "user-font"
  • {
    • font_name="Sans 11"
  • }
  • widget_class "*" style "user-font"
  • gtk-theme-name="QtCurve"
  • gtk-font-name="Sans 11"

Or open up the GTK-QT Styles & Fonts entry in kcontrol, and set the GTK Style to QtCurve. Done. You should have a desktop that looks like this (or something similar):

You can discuss this howto on the forums.