Translation(s): none

(!) ?Discussion


This page describes how to use the Qt GTK engine to make your GTK applications look like your Qt applications.

Installation

To install the Qt GTK engine, run:

aptitude install gtk-qt-engine

Establishing a colorscheme

The next thing you will need is your colorscheme. Luckily, KDE 4.x will generate one for you. Go to: System Settings > Appearance > Colors > Options tab, and choose "Apply colors to non-KDE4 applications". Your colorscheme for GTK apps will be written to:

$HOME/.kde/share/config/gtkrc-2.0

Setting up the gtkrc file

Since this file is regularly overwritten by KDE (probably every time you log in), you will want to back it up to another location. Copy this file to a new location (replace THEME_NAME with whatever you want):

mkdir $HOME/.themes/THEME_NAME
mkdir $HOME/.themes/THEME_NAME/gtkrc-2.0
cp -i $HOME/.kde/share/config/gtkrc-2.0 $HOME/.themes/THEME_NAME/gtk-2.0/gtkrc

This destination was specified because that directory is where Xfce and Gnome will look for themes (in case you use a utility from one of those desktop environments to set your GTK theme).

Now you need to add the following to the file, inside the style called "default" (i.e. right before the closing } around line 33):

  engine "qt4engine"
  {
  }

Setting the GTK theme

If you don't use Xfce or Gnome to set your GTK theme (and I hope you don't), it's easy enough to set the theme by using a .gtkrc.mine file. Run the following commands to create the necessary files and make GTK apps use your theme:

echo 'include "$HOME/.gtkrc.mine"' >> $HOME/.gtkrc-2.0
echo 'include "$HOME/.themes/THEME_NAME/gtk-2.0/gtkrc"' >> $HOME/.gtkrc.mine



CategoryDesktop