# KDE Display Manager (KDM)

Steffen
Hansen

    stefh@dit.ou.dk

09R/07/1998
0.05.01

This document describes the KDE Display Manager

KDE
kdm
xdm
display manager

## Introduction

The KDE Display Manager is a ``drop-in'' replacement for xdm, the X Display Manager and a little utility. kdmdesktop is to draw nice backgrounds. Kdm is superior to xdm in several ways:

- Kdm supports session arguments in a userfriendly way (xdm doesn't tell the user, which args it might generate).

- Kdm has an optional ``shutdown''-button (much like NT's login box).

- Kdm has an optional graphical view of users on the system (idea stolen from IRIX' login box).

- Kdm looks ways better than xdm ;-)

- Kdm can be configured with a graphical user interface (a part of the KDE control center)

## Installing kdm

### Setting up kdm

See the file README! It will tell you how to compile kdm. But normally you don't need to compile kdm yourself, as it is part of the kdebase package and compiled with all other stuff. It is then installed in your $KDEDIR/bin directory.

NOTE: `make install` will overwrite your previous `kdmrc`.

During the installation a new version of the file `Xsetup&lowbar;0` is installed. It espacially contains a line

    kdmdesktop

to display some nice backgrounds (pictures and background colors). Normally you find this file in the xdm config directory `/etc/X11/xdm/XSetup&lowbar;0` for Redhat and `/usr/X11R6/lib/X11/xdm/XSetup&lowbar;0` for S.u.S.E. If your KDEDIR is not /opt/kde you may have to change the path to kdmdesktop.

If you chose the PAM (which is normal with Red Hat 5 and 5.1) option, then you should check /etc/pam.conf for the lines

    # xdm authorization
    xdm    auth       required     pam_unix_auth.so
    xdm    auth       required     pam_unix_acct.so

and insert them, if they aren't there.

Now it's time to test kdm. You should bring your system to a runlevel that doesn't run xdm. To do so edit the file `/etc/inittab` and look for the lines saying

    # default runlevel
    id:3:initdefault:

The value after id: is the code of the default runlevel and very distribution dependent, but always well explained. The runlevel with graphical login (xdm) for the most common distributions are

- 5 for Red Hat 3.x, 4.x and 5.x, LST

- 4 for Slackware

- 3 for S.u.S.E. 4.x and 5.x

After this you can try to start kdm by typing the following command on your favourite shell:

    > kdm -nodaemon

If you get a kdm login box and you are able to log in, things are great. The main thing that can go wrong here, is that the runtime linker might not find the shared Qt or KDE libraries. When everything works, you can start to replace xdm by kdm. This is again distribution dependent.

- for Redhat you edit `/etc/inittab`, look for the string xdm and replace it with kdm (including all paths).

- for S.u.S.E. you have to edit the file `/sbin/init.d/xdm` and to add a first line

      . /etc/rc.config
      DISPLAYMANAGER=kdm
      export DISPLAYMANAGER

- for other distributions it's rather the Redhat way, but I'm not too sure about this.

For every distribution I know, you have to change the runlevel in the /etc/inittab file (to 5 for Redhat, 3 for S.u.S.E. as mentioned above or in the inittab file itself). If you have a binary distribution of the KDE libraries, make sure kdm is installed where the libraries believe kde is installed. This is again normally /opt/kde/bin. If you dont like changing inittab, you might instead rename xdm to xdm.bak and make xdm a symlink to kdm. Kdm will read the general display manager settings from the xdm configuration files and the kdm specific ones from the file &dollar;KDEDIR/share/config/kdmrc. Kdmdesktop will also read kdmrc.

### Different window managers with kdm (chooser)

If you have to use different window managers or you just want to try others from time to time you can take advantage of the chooser built into kdm. The chooser lets you choose a window manager of a predefined list. This again needs some changes in configuration files. First you have to change your `Xsession`-file (path is `/etc/X11/xdm/` for Redhat and `/usr/X11R6/lib/X11/xdm/` for S.u.S.E.) to pass parameters. To do so look at the lines `'exec $startup'` and change it to `'exec &dollar;startup " &dollar;@"'` (without ') After this you have to create/edit your /etc/xinitrc or /.xinitrc file to react on the different window managers. The following script has three different windowmanagers to start. You can add more stuff if you like. Don't forget to save a copy of your `.xinitrc` file to `/etc/skel`, so it will be automatically generated for every user you create from now on.

    #!/bin/bash
    #
    # .xsession/.xinitrc
    #
    # choose a window manager
    #

    defaultwm=kde
    #set the window manager to $1 if it was supplied
    windowmgr=${1:-$defaultwm}

    #start the respective window managers
    case ${windowmgr} in
      kde|kwm|kdestart)
    	WINDOWMANAGER=startkde
    	;;
      fvwm|fvwm2)
    	WINDOWMANAGER=fvwm2
    	;;

      fvwm95)
    	WINDOWMANAGER=fvwm95
    	;;

      *)    WINDOWMANAGER=windowmgr   # default for unknown wm's

    esac

    #
    # load resources
    #

    if [ -f /usr/X11R6/lib/X11/Xmodmap ]; then
        xmodmap /usr/X11R6/lib/X11/Xmodmap
    fi

    if [ -f ~/.Xmodmap ]; then
        xmodmap ~/.Xmodmap
    fi

    if [ -f ~/.Xdefaults ]; then
        xrdb -merge ~/.Xdefaults
    fi

    if [ -f ~/.Xresources ]; then
        xrdb -merge ~/.Xresources
    fi
    #
    # finally start the window manager
    #
    exec $WINDOWMANAGER

## Configuring kdm

There is a graphical tool for configuring kdm. You will find it under the menu K/Settings/Applications/. With this tool you can configure the kdm specific options (stored in kdmrc), but kdm still has to be set up properly just like xdm, so please read on.

The kdm-specific option are configured by editing the file "&dollar;KDEDIR/share/config/kdmrc". There are three sections in kdmrc:

### KDM

The keys in this section are

    StdFont
    FailFont
    GreetFont
    GreetString
    SessionTypes
    LogoPixmap
    ShutdownButton
    Shutdown
    Restart
    UserView
    Users
    NoUsers
    SortUsers
    GUIStyle

A short description of the keys:

*Font

  is a fontsstring formatted like this: Courier,12,5,iso-8859-1,50,0.

GreetString

  is the title of the kdm login window.

SessionTypes

  is a ``,'' separated list of session arguments. It defaults to `SessionTypes=kde,failsafe`. Above example uses additionally the fvwm2 and fvwm95 windowmanagers.

LogoPixmap

  Change this, if you dont like the logo.

ShutdownButton, Shutdown and Restart

  ShutdownButton controls when the shutdown button is displayed and can be one of `All`, `None`, `RootOnly` and `ConsoleOnly`. Shutdown and Restart are the commands to run on shutdown/restart. They default to `/sbin/halt` and `/sbin/reboot`. The meaning of All and None is very clear, if you choose ConsoleOnly you can't do a remote shutdown.

UserView

  If this is set to ``1'', a graphical view of users will be displayed in the kdm window.

Users

  is a ``,'' separated list of usernames that will be displayed in the graphical user view. If `UserView` is 1 and the `Users` entry is missing, kdm will look for users in the password file. The users displayed are those who have a real name beside their loginname, a home directory and a default shell - the rest is skipped. Kdm will look in &dollar;KDEDIR/share/apps/kdm/pics/users/ for an icon for each user. If there exists an icon named johndoe.xpm, kdm will use that for displaying user johndoe, if not kdm will use default.xpm. So if you have a little picture of every user on your system, just place them in &dollar;KDEDIR/share/apps/kdm/pics/users/ and have great fun logging in with kdm ;-) NOTE: Kdm is able to handle icons with different sizes, but it might not be too pretty to use both very small and very large icons.

NoUsers

  is a ``,'' separated list of usernames that won't be displayed. Use it to filter ``pseudo-users'' like `sync` and `shutdown` from the user view.

SortUsers

  If set to ``0'', the list of users are displayed in the order it was read. The default is to display users in sorted order.

GUIStyle

  can be either `Motif` or `Windows`.

### KDMDESKTOP

This section controls the background. The keys are:

    BackgroundPicture
    BackgroundColor1
    BackgroundColor2
    BackgroundPictureMode

A short description of the keys:

BackgroundPicture

  is the path to an image.

BackgroundColor&lsqb;1&verbar;2&rsqb;

  are named colors for solid and blended background.

BackgroundPictureMode

  can contain one of the following options:

  `None &verbar; Tile &verbar; Scale &verbar; Center &verbar; TopLeft &verbar; TopRight &verbar; BottomLeft &verbar; BottomRight &verbar; Fancy`

  Note that `Fancy` background looks nice, but is very slow.

### Locale

This section should only contain one single entry.

Language

  is indicating the language to use for kdm. It can be changed independently from KDE. The values are the same as usual en/de/fr/da etc.

## Legal stuff

Kdm is derived from xdm, so how is the copyright? Kdm 0.1 was done by Matthias Ettrich. All later version by Steffen Hansen `stefh@dit.ou.dk`

Kdm is free software. I'm not sure exactly how it's license is, because it has a lot of code from xdm in it. Anyway, i have to state:

Kdm requires the Qt library, which is copyright Troll Tech AS. Freely distributable programs may generally use Qt for free, see the file README.QT for details. Anyone is allowed to change kdm and redistribute the result as long as my name is mentioned.

And by the way: Kdm is provided as is with no warranty of any kind, including the warranty of design, merchantability and fitness for a particular purpose.

The documentation extended by Gregor Zumstein`zumstein@ssd.ethz.ch`. Last update is July, 9 1998