Chapter 8. Supporting multiple window managers

kdm detects most available window managers and desktop environments when it is run. Installing a new one should make it automatically available in the kdm main dialog's Session Type submenu.

If you have a very new window manager, or something that kdm does not support, the first thing you should check is that the executable to be run is in the PATH and has not been renamed by the distributor into something unexpected.

If the case is that the session type is not supported by kdm yet (maybe because it is too new), you can quite easily add it.

The session types are defined by .desktop files located in the directories listed in SessionsDirs. The last named directory contains the system-provided default session types and is $KDEDIR/share/apps/kdm/sessions in an installation from source. Software upgrades will typically overwrite anything in here, so it is unwise to use it for configuration purposes. Instead, a separate configuration directory should be listed first. It is set to $KDEDIR/share/config/kdm/sessions in an installation from source, but distributors often change it to something like /etc/kde4/kdm/sessions. You can simply add an appropriately named .desktop files here. The fields are:

[Desktop Entry]
Encoding=UTF-8 This is fixed to UTF-8 and
may be omitted
Type=XSession This is fixed to XSession and
may be omitted
Exec=executable name Passed to
eval exec in a Bourne shell
TryExec=executable name Supported
but not required
Name=name to show in the kdm session list

There are also three magic types:

default

The default session for kdm is normally KDE but can be configured by the system administrator.

custom

The Custom session will run the user's ~/.xsession if it exists, falling back to the default session otherwise.

failsafe

Failsafe will run a very plain session, and is useful only for debugging purposes.

To override a session type, copy the .desktop file from the data dir to the config dir and edit it at will. Removing the shipped session types can be accomplished by shadowing them with .desktop files containing Hidden=true. For the magic session types no .desktop files exist by default, but kdm pretends they would, so you can override them like any other type.