Notes about the KDE

Updated: 2013-02-08
Created: 2005-05-16

Structure of the KDE (130208)

The K[ool] Desktop Environment is a both a framework for the execution of GUI applications, and a collection of GUI applications based on that framework.

Its structure for both KDE 3 and the KDE SC 4) can be described so:

Structure of the information databases

The KDE SC4 contains a new and fairly complex and vast sbusystem to hold information about people and files, in three layers:

Some details:

Some links:

KDE tips (071229)

Terminate the DCOP server and the whole of KDE
dcopserver_shutdown
Terminate any KDE application
dcop app MainApplication-Interface quit
Restart the Kicker after updating menus etc.
dcop kicker kicker restart
Refresh screen
dcop kwin KWinInterface refresh
Pop up the K-Menu
dcop kicker kicker showKMenu
Start the screen saver and locker
dcop kdesktop KScreensaverIface lock
kdesktop_lock
Start a KDE application efficiently
kwrapper app ....
Listing the available KIO slaves
Run kcmshell ioslaveinfo. This will also give some documentation on some of the slaves, and hints (sometimes) on how to configure them.
List the visible Control Center modules
Run kcmshell --list.
List all the Control Center modules
For some reason kcmshell --list will not list some useful modules, so to list all of them first find the directory where the file kcm_style.so is contained (for example /usr/lib/kde3), and all the available modules will be in that directory, list them with ls kcm_*.so.
Some settings not available from the GUI
There is a list of (hidden) settings that can only be changed in configuration files.
KDE SC 4 has reduced functionality SSL/TLS support
The SSL/TLS support from KDE 3 has not been ported to the KDE SC 4 which is missing quite a bit of functionality.
Change the location of cache etc. from /var/tmp/
As listed in the KDE environment variables page set KDEVARTMP to something else, e.g. $HOME/tmp or /tmp itself.
Configure Konqueror extensions
These can be configured in the Settings:Configure Extensions dialog, and its three tabs. Note that extensions must be loaded to configure them, which means for example that to configure KHTML you must have visited a web site (thanks to Sho for this note). You can access the extensions you enabled mostly via the Tool menu.
Bookmark Toolbar folder
Traditionally the folder from which the bookmarks displayed in the Bookmark Toolbar is called Personal Toolbar Folder. Whatever its name it must be tagged by starting KEditBookmarks (e.g. with Bookmarks:Edit) and marking it as the Toolbar Folder by right clicking on it and selecting Set as Toolbar Folder.
Change the location of the Trash
Edit $KDEHOME/share/config/kdeglobals the section [Paths] setting Trash to the path of the directory you want.
Adding a new Konqueror URL type
Konqueror can delegate handling of particular types of URL to external programs. To do this one must define a suitable .protocol file (somewhat similar to .desktop files) and put it in the appropriate services/ directory. You can fine examples of .protocol files in the system services/ directory, which is for example /usr/share/services/ for me.
Using aRts remotely
Described in this message. The essential two actions are to enable the aRts server for networked operation in Sound & Multimedia:Sound System:General and then set a port in the Hardware:Use Other Custom option field. Then the environment variable ARTS_SERVER must be set on the clients.
Configuring language negotiation for HTTP
Edit $KDEHOME/share/config/kioslaverc and add at the top (not in any section) a line setting Languages, using a syntax suitable for the Accept-Languages HTTP header, for example:
Languages=en-gb;q=0.8,en;q=0.6,fr;q=0.4,it;1=0.2
Some useful buttons for the Kicker
I think that it is very useful to have on the Kicker (the KDE panel) these buttons: Settings Menu, Print System Menu, Konqueror Profiles Menu, Terminal Sessions Menu, and the Run command, Desktop Preview & Pager, Taskbar, System Tray and Klipper applets.
Focus policy and focus stealing prevention
The KWin window manager for KDE supports several focus policies (configurable in the Control Center's Desktop:Window Behaviour:Focus panel) and focus stealing prevention (configurable in the Control Center's Desktop:Window Behaviour:Advanced panel) levels. However not all combinations of the two make sense:
  • With Focus Follows Mouse or Click To Focus the focus stealing prevention level should be Normal, Low or more usually None, otherwise newly created windows and popups will be stacked below the currently active windows.
  • With Focus Under Mouse or Focus Strictly Under Mouse the stealing prevention levels that make sense are only High and Extreme or else often the focus will not be under the mouse.

Missing documentation

Configuration files places (120216)

CA certificates
Under /usr/share/kde4/apps/kssl/.
Akregator list of feeds
$KDEHOME/share/apps/akregator/data/.

Syntax of the Advanced Web Shortcuts (080912)

The Konqueror advanced web shortcuts have been introduced by Andreas Hochsteger in 2002, but the corresponding documentation update seems not to have made it to the Konqueror handbook, do this is a much updated version of the documentation update by the original author.

Every web shortcut is a template where the parts to be replaced with user input are marked with the substitution syntax \{...}.

The most commonly used is \{@} which works well for most of the query URIs on the web. But there are several more advanced substitution specifiers:

For example Advanced Google Search can be accessed with the web shortcut ggx with this template (displayed on multiple lines, even if it is just one string):

http://www.google.com/search?num=\{num,"10"}&safe=\{safe,"active"}&lr=\{lang}
&as_epq=\{exact}&as_oq=\{any}&as_eq=\{without}&as_qdr=\{date,"all"}&as_occt=\{occ,"any"}
&as_ft=\{ft,"i"}&as_filetype=\{filetype}&as_dt=\{siteop,"i"}&as_sitesearch=\{site}
&as_q=\{all,@}

The various subtitutions in the template mean:

An example use of the Advanced Google Search shortcut could be:

ggx:num=20 site=kde.org date=m3 kde konqueror

The resulting URI after substitution of the web shortcut values is then (displayed on multiple lines, even if it is just one string):

http://www.google.com/search?&num=20&safe=active&lr=
&as_epq=&as_oq=&as_eq=&as_qdr=m3&as_occt=any
&as_ft=i&as_filetype=&as_dt=i&as_sitesearch=kde.org
&eas_q=kde+konqueror

Performance improvements (050601)

KDE was initially designed as a lean, high performance desktop environment, where thanks to the use of a single widget library and set of common resources and libraries would lead to decreased memory usage and better UI consistency.

The KDE has greatly expanded in scope, and in particular it is now aiming to support a number of standards that do not necessarily help, and to be a leading desktop environment, which implies a high degree of newbie-oriented wow factor which leads to eye-candy being enabled by default over speedy operation.

But fundamentally the KDE still has some elements of architectural integrity that mean that (relatively) lean, efficient operation is possible. What follows is a collection my own discoveries on how to improve KDE performance, and in particular under recent versions of the Linux kernel and within recent GNU/Linux distributions.

The main performance problems with the KDE are mostly caused by:

KDE performance issues can be tweaked therefore at several different levels:

A quick and temporary list of suggestions

Resources

Fixes I'd like to see (050610)

What's good and bad about the KDE (050610)

The KDE was designed on the premise that using a single set of widgets was more consistent and efficient than the mixed variety then prevalent with X applications.

It was also founded by Europeans using largely European developed tools.

In its evolution the KDE has remained largely true to its origins; the whole KDE is based not just on a common widget library, but also a common set of higher level libraries.

The common set of higher level libraries has been with time supplemented by an RPC mechanism and a set of daemons that provide active shared services too.

The KDE developers have also managed by and large to restrain themselves from making a whole mess like GNOME, and to maintain some degree of consistency and discipline in the implementation.

Major good points

KDE command line

Non-graphical commands from layers below KDE:

qdbus
  • qdbus org.kde.kded /kded quit
  • qdbus org.kde.kwin /KWin \
      org.kde.KWin.cascadeDesktop
  • qdbus org.kde.kded /modules/networkstatus \
      setNetworkStatus ntrack 4
xdg-desktop-icon
xdg-desktop-menu
xdg-icon-resource
xdg-mime
xdg-settings
xdg-user-dir

Graphical commands from layers below KDE:

qtconfig-qt4
xdg-email
xdg-open
xdg-screensaver

Non-graphical KDE commands:

kcmshell4
kstart
startkde
kwrapper4
kde4
kdeinit4
kreadconfig, kwriteconfig

Graphical KDE commands:

kcmshell4
kstart
startkde
kwrapper4
kde4
kdeinit4
kreadconfig, kwriteconfig

The major bad points of the choices made in the evolution of the KDE