KDE Themes

[ Site Index] [ Linux Index] [ Feedback ]

One of the interesting things about KDE is that it is highly customizable. (It's not as customizable as the combination of Gnome and the Enlightenment window manager will eventually be, but it's certainly customizable enough for now!)

As with all graphical user environments (GUIs) you can change the colours of various 'widgets' -- components common to all programs using the environment, like window borders, window backgrounds, title bars, and so on. You typically do this from the KDE Control Center, by selecting the Desktop group of control panels (Background, Colors, and similar.)

However, the properties that you can change in this manner are limited to the items the authors of those control panels saw fit to add to their programs, and the options available are limited to those colours and bitmaps included with the installed base system. With a bit of poking around, you can change a lot more than that.

You can also edit the hierarchy of menus pulled down from the "K" menu on the Control Panel; I'll discuss this in another article.

An interesting aspect of KDE is that it is a multi-user system, like Linux. So you can make global changes, which modify the way KDE behaves for all users of a system, and local changes, which affect the way KDE looks for a single user.

Where KDE stores its configuration

KDE relies on configuration files and resources. A configuration file contains directives which tell components of the KDE software how they are to present themselves to the user. A resource is some item that the KDE software must load in order to obey a configuration directive.

KDE is installed on a Linux (or UNIX-oid) machine in a directory tree, typically under /opt or /usr/local -- this needs to be identified by the environment variable KDEBASE so that KDE knows where to find all its components.

Global configuration files
These are found in $KDEBASE/share/config. A file, usually ending in "rc", is present for each program that has separately stored configuration information; for example, if $KDEBASE is /opt/kde, the file /opt/kde/share/config/ktelnetrc contains configuration settings for the program ktelnet.
Per-user configuration files
Each user who is running KDE has a hidden directory called .kde in their home directory. The .kde directory contains a tree of directories that mimics the structure of the tree under KDEBASE. So a user might has a ktelnet configuration file called ~fred/.kde/share/config/ktelnetrc. If this is the case, whenever the user fred runs ktelnet, their own settings will override the global settings.
Global resources
A whole slew of resource files are stored below $KDEBASE/share.

The following directories are worth knowing about, if you want to replace some of the resource files:

contains X pixmaps used as icons in the KDE environment; see the style guide for details of their size, permitted colours, and general characteristics.
contains much smaller X pixmaps used as mini icons in the KDE environment.
contains subdirectories for each KDE appliction installed on the system. Each application directory contains per-application resources; for example, logos (as X pixmaps), special toolbar icons, and so on.
contains kdelnk files and subdirectories which appear in the "K" menu and can be edited with the KDE menu editor; see Making KDE work with other applications for a discussion of how these work.
contains the HTML online help documentation for KDE. (More about this some other time.)
is important if you live outside the USA; it contains locale information. KDE is internationalised; this means it can display menus and online help in any language for which appropriate configuration files exist. A variable is used to specify the 'locale' in which KDE is running; thereafter, KDE applications use the character set specified in share/locale/localeID/locale, (where localID is the locale to use -- e.g. "fr" for French). KDE applications also get their menu entries from files stored in share/locale/localeID/LC_MESSAGES/progname.mo, where progname is the name of a program; for example, the file share/locale/fr/LC_MESSAGES/kpanel.mo provides messages for kpanel to display in its menus and dialogs when the French locale is in use. (NOTE: these files are compiled! This means you can't edit them by hand and shouldn't even look at them using less or more.)
contains mimelink files, as described in Making KDE work with other applications.
contains X pixmaps of toolbar items used by more than one application.
contains wallpaper. Wallpaper consists of GIF or JPEG images -- either large backdrops which can be displayed on the root window, or small 'tiles' -- symmetric images -- which can be replicated across the screen in a regular pattern.

Changing the appearence of windows

Some of the application pixmaps appear throughout KDE. In particular, KWM, the K window manager, is responsible for the look and feel of all the windows in the KDE environment, and for their behaviour. You can change the appearence of the buttons decorating KDE's windows by looking in KDEBASE/share/apps/kwm/pics and replacing the files close.xpm, iconify.xpm, maximize.xpm, maximizedown.xpm and menu.xpm. Here's a before-and-after view: first, a small dialog box with the standard pixmaps, and then one where KWM has been given the "metal" look and feel (associated with MacOS System 8):

Standard: KFM showing standard decorations
Metal: KFM showing metal decorations

The buttons named above appear as decorations on windows; you can configure their actions via the KDE Control Center (the Windows section sets up the various types of KWM behaviour). You can also change the appearance of the title bar at the top of your windows. Two pixmaps are used, for the current active window and for all inactive windows; if you use the Windows/Titlebar control you can pick new pixmaps or set them to a flat-shaded colour. Try adding a new pixmap for fun ...

Adding wallpapers: tweak KDE settings by hand

Both GIF and JPEG images seem to be acceptable as wallpaper in KDE. Wallpaper files stored in KDEBASE/share/wallpapers can be loaded via the Desktop/Backgrounds control; you can specify that they are to be used as a tile (replicated across the screen, edge to edge), or centred on the screen. Centred images should be as large as your normal working X resolution -- for example, 1024x1280 pixels.

Wallpaper is assigned on a per-desktop basis (remember, KDE provides virtual desktops). It can be a bit of a bind to use the control to select and apply the same wallpaper to eight desktops; so you can edit the file ~username/.kde/share/config/kdisplayrc using an editor such as vi (or kedit, if you're not a real UNIX hacker :).

Look for a line beginning with:

Where n is a digit. Lines following this one, but before any other lines containing a keywork enclosed in square brackets, set the desktop configuration options for desktop n.

Lines beginning with a hash mark "#" are comments and ignored by KDM.

In particular, the wallpaper for desktop n is set with a few lines like this:

WallpaperMode=Tiled UseWallpaper=true Wallpaper=bigmars.jpg
This means: use wallpaper, tile the image file across the display, and the wallpaper to use is the file bigmars.jpg (in KDEBASE/share/wallpapers).

In general, an important lesson to learn is that most of the look and feel of KDE can be configured by dinking with the rc files stored in ~user/.kde/share/config -- sounds can be bound to events in kcmsyssoundrc, the behaviour of the K window manager can be overriden in kwmrc, the mouse settings in kcminputrc, and so on.

Importing Windows 95/98 "themes"

Windows 95 is similarly customizable. A "theme" is a package containing cursor bitmaps, icons (for the standard desktop objects), wallpapers, and settings for the various window decorations.

A program which partially converts Windows themes into KDE themes is available from ftp.kde.org; look for win2kdethemes.perl.

This program does not convert icons; while some Windows 95 icon formats can be converted into X pixmaps using ico2xpm (from the sunsite archive) this utility does not recognize all Microsoft icon formats. Nor does it convert cursors (the Qt library KDE is based on doesn't seem to know how to mangle X cursors). But it can import the backgrounds and widget colour settings from a Windows theme archive.

[ Site Index] [ Linux Index] [ Feedback ]