Gentoo Logo

The KDE Configuration HOWTO

Content:

1.  What is the K Desktop Environment?

The Project

The KDE Project is a free software project dedicated to the development of KDE, an open source graphical desktop environment for Linux and Unix workstations. The development is carried out by several hundred software engineers from all over the world committed to free software development. See also What is the KDE Project.

The Software

The K Desktop Environment is an easy-to-use desktop environment built around a well thought out application framework to allow for application interoperability, drag n drop and so on. Apart from the essential components, the KDE environment also provides ready-to-use applications for 101 tasks: file management, Internet browsing, office applications, e-mail handling, ... Everything is covered by the KDE project.

The KDE environment is available in more than 70 languages and has an immense user base. For those interested, there are lots of screen shots available. For more information on KDE, read the What is KDE? article on KDE.org.

The Community

Many KDE-based community sites exist. On KDEnews.org you'll find the latest news on KDE generally. KDEdevelopers.org is specifically focussed on KDE development, while KDE-forum is better suited for the large masses. More links can be found on the KDE Family page.

2.  Installing KDE

What do you need?

If you're interested in installing KDE (or KDE support), you will have to make sure that your USE variable contains the kde flag, and either the qt3 or qt4 flag (or both). Qt is the graphical widget library that KDE uses, and qt3 is for version 3.x, while qt4 will build support for the newer Qt 4.x library. Neither USE flag is necessary for installing KDE. However, there are a few packages that offer you the choice of using either the qt3 or qt4 libraries.

You should also add hal to your USE variable now if you want to add support for mounting devices automatically as explained below in Setup KDE to Mount Devices.

If you do not want to use aRts for your all-around multimedia, disable the arts USE flag (it is active by default).

Note: The Gentoo 2006.1 release introduced a number of new profiles, including the desktop subprofile. You may want to switch to this subprofile, if it exists for your architecture, as it contains a number of default USE flag changes. Please read the Gentoo Upgrading Guide to learn how to switch profiles.

Installing KDE as Split Packages

Note: We recommend that you use the split packages to install KDE (rather than the monolithic packages, though both methods will be presented), as shown below.

If you want to have more control on what parts of KDE you install, you have the possibility to install just the single KDE applications that you need. To know more about the ebuilds for the individual KDE programs see the Split Ebuilds HOWTO.

Knowing what to install and what not is a tad more difficult with split ebuilds. However, Gentoo does provide a few meta packages that will pull in a certain amount of KDE packages for you:

  • If you want a full-blown KDE installation, install kde-meta. This package will pull in all KDE applications as dependencies.
  • If you want a basic KDE installation, install kdebase-startkde. You can always install additional KDE applications when you want.
  • If you want something in between kde-meta and kdebase-startkde, install kdebase-meta. This will install a few extra applications such as konsole and kdm.

These three possibilities are the extreme limits; you are probably interested in a safe mixture of the two :) To make your decision process somewhat easier, the following table gives a short, very incomplete yet useful overview of some of the available KDE packages.

These packages are not part of the kdebase-startkde installation.

Ebuild name Description
akregator The application to easily manage and browse internet RSS feeds.
juk The playlist oriented media player, with a look and feel resembling Apple's iTunes.
kate The KDE Advanced Text Editor, a multi-document editor with syntax highlighting, code folding and more.
kmail Organize your e-mails efficiently with KMail.
knetattach With KNetAttach (also known as the Network Folder Wizard), you can easily add additional network folders to your KDE desktop.
knode KNode is the powerful KDE newsreader.
konsole Konsole is the KDE terminal emulator.
kontact Kontact is the KDE Personal Information Manager, helping you manage your communications more easily, organize your work faster and work together more closely.
kopete Kopete is KDE's Instant Messenger supporting all known IM protocols.
korganizer Korganizer is the calendar and scheduling application for KDE.
kpdf With KPDF you can view and work with PDF files. It has very unique features which enhance your viewing pleasure enormously.
kscd kscd is a graphical CD player for KDE.
ksnapshot With ksnapshot you can take screen shots from your desktop.
kuickshow The KDE kuickshow application is able to browse amongst and display various image formats.

And this is just the tip of the iceberg. If you want to know more about all possible KDE applications, take a look inside the kde-base category. Their function should be available in the description.

To preview what emerge would install, use emerge -p together with the less pager, otherwise you might not be able to see all packages.

Code Listing 2.1: Previewing the kde installation

(Substitute with your choice of package(s))
# emerge -p kdebase-startkde | less

If you are happy with the proposed result, leave the -p out. This building process will take some time as KDE is a big environment. Don't be surprised when your system does not finish immediately.

Installing KDE as Monolithic Packages

Although the split ebuilds are the recommended way to install KDE, you do have the option of installing the monolithic ebuilds.

The KDE project releases new versions of its desktop environment as a set of about 16 big packages, each containing many applications (thus they are called "monolithic"), so you need to decide which of these packages you want to install.

If you want to see what it looks like to have all these packages installed, just check yourself:

Code Listing 2.2: Listing all packages KDE would install

# emerge --pretend kde | less

If you're not interested in installing all those packages, you can emerge them individually. You will most definitely want the kdebase package as it contains KDE's base packages and required dependencies. The following table lists some of the other available packages that you can install.

Package Description
kdeaccessibility Accessibility related programs, managed by the KDE Accessibility Project
kdeadmin KDE Administrative tools, such as KCron (Task Scheduling), KUser (User Management) and KDat (Backup Management).
kdeartwork Various art-related stuff, including screen savers and themes. See also www.kde-artists.org for more KDE related artwork.
kdeedu Educational KDE applications focused on school children aged 3 to 18. See also the KDE Edu Project.
kdegames Various KDE-developed games. More information can be found at the KDE Games Center.
kdegraphics Graphic-related tools for KDE, including KSnapshot (Screenshot Software), KolourPaint (Simple Graphical Editor), Kpdf (PDF viewer), KIconEdit (Icon Editor) and KPovModeler (a 3D Modeler).
kdemultimedia Multimedia-related applications, including support for CD, MP3, DVD, sequencing, sound and video applications. More information can be found on the KDE Multimedia Project web site.
kdenetwork Network-related applications such as Kopete (Multi-Protocol Instant Messaging), kppp (Dial-In) and KSirc (IRC client). Note that konqueror (File Manager and Browser) is part of kdebase!
kdepim Personal Information Management tools, such as KOrganizer (Journal), KAddressbook (Address book), Kontact (Groupware) and KMail (E-mail). More information online at the KDE PIM Project web site.
kdesdk Code development tools, including KBabel (Translation tool), KBugBuster (Front end for KDE bug tracking) and Kompare (GUI to see differences between files).
kdetoys Various toys to amuse yourself with when you're waiting for your pizza delivery. You'll find applets such as eyesapplet and fifteenapplet, but also nifty tools like amor which doesn't do much except eat resources :)
kdeutils Graphical system tools such as kcalc (Calculator), kdessh (SSH terminal), kfloppy (Floppy-related actions), etc.
kde-i18n Internationalization files for KDE. This includes translated documentation. See also the KDE i18n project for more information.

For instance, to install KDE with only the network- and admin-related applications:

Code Listing 2.3: Example installation of individual KDE components

# emerge kdebase kdenetwork kdeadmin

In case you wonder: compiling KDE does take a while.

External KDE applications

The number of KDE applications is not limited to those shipped with the official KDE releases, but includes hundreds of other applications that use the KDE framework and libraries. Here we list just a few of the most popular ones.

Ebuild name Description
koffice KOffice is the comprehensive KDE office suite, featuring applications for word processing (KWord), spreadsheet calculations (KSpread), presentation (KPresenter), image manipulation (Krita), database management (Kexi) and much more. Just as KDE can be installed through the kde or kde-meta ebuilds, you can install KOffice as a single package (koffice) or as a set of individual packages (koffice-meta).
amarok With amaroK you have a powerful music player for Unix/Linux.
k3b K3B is a complete CD/DVD burning utility with Audio support. Burning CDs was never this easy.
kaffeine Kaffeine is a full featured multimedia-player for KDE.

First Impressions

Let us have a look at the result. Your mother has probably told you never to work as root. So we'll take your mother's advice and test KDE as a user. Log in as your user and configure your session so it starts KDE when you issue startx. You can do this by writing exec startkde in ~/.xinitrc (see also Using startx in the X Server Configuration Howto):

Code Listing 2.4: Configuring your local session

$ echo "exec startkde" > ~/.xinitrc

Now start up your graphical environment by running startx.

Code Listing 2.5: Starting KDE

$ startx

You will be greeted by an application called KPersonalizer. Congratulations, let's now take a look at how we can configure KDE...

3.  Configuring KDE

KPersonalizer

KPersonalizer is the application that configures KDE for you. It's a very useful wizard that allows you to quickly change KDE to suit your own needs. When you run KDE for the first time, KPersonalizer is automatically started.

The first input KPersonalizer requests is your country and the language of your choice. As we haven't installed the necessary language packs on your system yet, the available languages will be very slim -- you'll probably have only English to choose from. Don't mind this, we will change the language later on (if applicable of course).

The second choice you're offered is the System Behavior. This includes window activation, mouse selection, etc. When you select a certain behavior its description is shown to help you choose the behavior you like. If you're uncertain, don't panic -- you are able to change the behavior whenever you want.

Next, KPersonalizer asks for the amount of eye-candy it should activate. The more eye-candy you want, the funkier your KDE will be, but the more your CPU will be stressed. However, this should be taken with a bit of salt - on a 600 Mhz CPU with 128 Mb of memory, enabling full eye-candy still results in a responsive system.

Finally, KDE asks what style you want to use. A style defines the window decoration, theme, button layout, etc. Try several styles to see which one you like the most. Did we already mention KDE is fully configurable?

Now sit back and enjoy -- KDE will start up and you'll be greeted by a nice, clean, functional desktop environment.

Installing Language Packs

If English isn't your native language or you're just interested in working with KDE in a foreign language, please read on. We will install the language pack(s) for the language(s) you want to use with KDE.

Language packs are contained in the kde-i18n package. To install the language packs of your choice, you need to set the LINGUAS variable to the language(s) you want to use. It is advisable to set this variable in /etc/make.conf so that updating your system doesn't remove the language packs you want.

Code Listing 3.1: Setting LINGUAS in /etc/make.conf

# nano -w /etc/make.conf
(As an example, we install the language packs for Dutch (nl) 
 and French (fr))
LINGUAS="nl fr"

Now run emerge kde-i18n to install the language packs. Once settled, fire up KDE, then start the KDE Control Center (K-menu > Control Center). This is the application where you can control almost every aspect of KDE. It is much more extended than KPersonalizer.

To change your language, go to Regional & Accessibility, Country/Region & Languages. Then add the language(s) of your choice. To see your (localized) KDE in its full glory, log out and in again, and enjoy.

Graphical Login

If you want to use kdm as graphical login manager (which means you don't have to login to a terminal and type startx every time) you need to first emerge it, and then edit a configuration file and set up your system so that it enters graphical mode after boot, as explained below.

Note: It's possible that you already have kdm installed for various reasons. If you get an error with packages blocking kde-base/kdm, proceed with the next section.

Code Listing 3.2: Installing kdm

# emerge --ask kdm

In /etc/conf.d/xdm, set the DISPLAYMANAGER variable to kdm.

Code Listing 3.3: Setting DISPLAYMANAGER in /etc/conf.d/xdm

# nano -w /etc/conf.d/xdm
(Edit the following variable)
DISPLAYMANAGER="kdm"

Finish up by adding xdm to the default runlevel:

Code Listing 3.4: Adding xdm to the default runlevel

# rc-update add xdm default

When you reboot your system, it will use KDM as the graphical login manager.

KDM will provide a list of available sessions to choose from, including KDE - of course - and including all the other sessions installed on your system, which KDM finds by looking in /usr/share/xsessions/. Thus, if you use KDM, you don't need to edit ~/.xinitrc.

Setup KDE to Mount Devices

KDE gives you the power to mount devices such as CDROMs or USB sticks through a single click in a graphical interface. To accomplish this goal you need to have KDE compiled with hal in your USE variable and to have dbus and hal installed on your system. You should also add dbus and hal to the default runlevel and add yourself to the plugdev group.

Code Listing 3.5: Setup device mounting

# emerge --ask dbus hal
# rc-update add dbus default
# rc-update add hald default
Add <user> to the plugdev group
# gpasswd -a <user> plugdev

4.  Managing KDE Installations

Multiple Installations

One peculiarity of the way KDE is managed in Gentoo is that when a new series of KDE appears (such as the 3.5.x series, which supersedes the 3.4.x series) it will be installed alongside the old one and will not overwrite it. So if for instance you had KDE 3.4 already installed and you emerge KDE 3.5, you will have two versions, one installed in /usr/kde/3.4/ and the other in /usr/kde/3.5/.

It should be noted that your settings for different KDE installations will be kept separate in the home directory. KDE 3.4 reads its settings from the directory /home/<user>/.kde3.4, and the first time you run KDE 3.5 a directory named /home/<user>/.kde3.5 will be created by migrating the settings in the 3.4 directory and will be then used to store preferences and data.

Another important remark to keep in mind when upgrading your KDE installation is that you could have problems with the external KDE applications you have installed (such as koffice, amarok or k3b) until you recompile them against the new KDE version. So as soon as you start using the new KDE you should reemerge them to make them link against the new libraries.

Unmerging Old Versions

Having multiple versions of KDE installed poses the problem of how to remove the old ones when we decide that they are not needed anymore. Unfortunately portage does not support unmerging a package with all its dependencies with a single command, so if for instance you run emerge --unmerge kde you will not remove the actual kde packages.

To remove a KDE installation (e.g. KDE 3.4), the single packages have to be removed.

Code Listing 4.1: Removing KDE 3.4 packages

# emerge --unmerge =arts-3.4* =kdelibs-3.4* =kdebase-3.4* ...

Obviously this is very frustrating if you have many KDE packages installed. However this operation can be automated in many ways. The following one is an example.

First we list all the packages that we want to remove. We use the equery command for this, part of the app-portage/gentoolkit package:

Code Listing 4.2: Listing packages to remove

(List all the installed KDE packages)
# equery list kde-base/
(List all the installed KDE packages and select the ones from KDE 3.4)
# equery list kde-base/ | grep 3\.4

At this point you should double-check that the list corresponds to the packages that should be removed from the system. If you think it is ok, you can go on and pass the list to the emerge --unmerge command.

Code Listing 4.3: Removing selected packages

# equery list kde-base/ | grep 3\.4 | xargs emerge --unmerge --pretend

Check again the output and reissue the command without --pretend to start the unmerging process.

After the job has completed, the directory /usr/kde/3.4/ should contain only a few files (mainly configuration files, portage has a policy to never touch configurations). If you desire, you can safely wipe out /usr/kde/3.4/ with its content to remove what remains of KDE 3.4.

5.  Frequently Asked Questions

KDE is extremely slow during startup

Make sure your /etc/hosts file is correct:

  • If you have a static IP address, make sure your FQDN and hostname are mentioned on that line, like 192.168.0.10 tux.mydomain tux
  • If you have a dynamic IP address or you do not have any additional interfaces at all, add your hostname after the localhost statement, like 127.0.0.1 localhost tux

Check if you have DMA enabled for your disks:

Code Listing 5.1: Verifying DMA settings

# hdparm /dev/hda
(...)
using_dma       = 1 (on)
(...)


Print

Updated June 23, 2007

Summary: One of the most used desktop environments is KDE. This guide tries to describe all aspects of KDE, including installation, configuration and usage.

Sven Vermeulen
Author

Gregorio Guidi
Editor

Donate to support our development efforts.

Support OSL

Support OSL

Gentoo Centric Hosting: vr.org

VR Hosted

Tek Alchemy

Tek Alchemy

SevenL.net

SevenL.net

Global Netoptex Inc.

Global Netoptex Inc.

Bytemark

Bytemark

Linux World Expo

Linux World Expo

Copyright 2001-2008 Gentoo Foundation, Inc. Questions, Comments? Contact us.