<!doctype linuxdoc system>

<article>

<!-- Title information -->

<title>KDE Display Manager (KDM)
<author>Steffen Hansen, 
<tt><htmlurl url="mailto:stefh@dit.ou.dk" name="stefh@dit.ou.dk"></tt>
<date>Version 0.5-1, 9 July 1998 
<abstract>
This document describes the KDE Display Manager
</abstract>

<!-- Table of contents -->
<toc>

<!-- Begin the document -->

<sect>Introduction

<p>
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:
<itemize>
<item>Kdm supports session arguments in a userfriendly way (xdm doesn't
tell the user, which args it might generate).
<item>Kdm has an optional ``shutdown''-button (much like NT's login
box).
<item>Kdm has an optional graphical view of users on the system (idea
stolen from IRIX' login box).
<item>Kdm looks ways better than xdm ;-)
<item>Kdm can be configured with a graphical user interface (a part of
the KDE control center)
</itemize>

<sect>Installing kdm
<p>
<sect1>Setting up kdm
<p>
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.
<p>
<bf/NOTE:/ <tt/make install/ will overwrite your previous <tt/kdmrc/.
<p>
During the installation a new version of the file <TT/Xsetup_0/ is 
installed. It espacially contains a line
<tscreen><verb>kdmdesktop</verb></tscreen>
to display some nice backgrounds (pictures and background colors).
Normally you find this file in the xdm config directory
<tt>/etc/X11/xdm/XSetup_0</tt> for Redhat and
<tt>/usr/X11R6/lib/X11/xdm/XSetup_0</tt> for S.u.S.E.
If your KDEDIR is not /opt/kde you may have to change the path to kdmdesktop.
<p>
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
<tscreen><verb>
# xdm authorization
xdm    auth       required     pam_unix_auth.so
xdm    auth       required     pam_unix_acct.so
</verb></tscreen>
and insert them, if they aren't there.
<p>
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 <tt>/etc/inittab</tt> 
and look for the  lines saying
<tscreen><verb>
# default runlevel
id:3:initdefault:
</verb></tscreen>
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
<itemize>
<item>5 for Red Hat 3.x, 4.x and 5.x, LST
<item>4 for Slackware
<item>3 for S.u.S.E. 4.x and 5.x
</itemize>

After this you can try to start kdm by typing the following command on 
your favourite shell:
<tscreen><verb>
> kdm -nodaemon
</verb></tscreen>
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.
<itemize>
<item>for Redhat you edit <tt>/etc/inittab</tt>, look for the string xdm
and replace it with kdm (including all paths). 
<item>for S.u.S.E. you have to edit the file <tt>/sbin/init.d/xdm</tt> and to
add a first line
<tscreen><verb>
. /etc/rc.config
DISPLAYMANAGER=kdm
export DISPLAYMANAGER
</verb></tscreen>
<item>for other distributions it's rather the Redhat way, but I'm not too sure
about this.
</itemize>
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.

<sect1>Different window managers with kdm (chooser)
<p>
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 <tt/Xsession/-file (path is
<tt>/etc/X11/xdm/</tt> for  Redhat and <tt>/usr/X11R6/lib/X11/xdm/</tt> for
S.u.S.E.) to pass parameters. To do so look at the lines <tt>'exec
$startup'</tt> and change it to <tt>'exec &dollar;startup " &dollar;@"'</tt>
(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 <tt/.xinitrc/ file to <tt>/etc/skel</tt>, so it
will be  automatically generated for every user you create from now on.
<tscreen><verb>
#!/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

</verb></tscreen>

<sect>Configuring kdm

<p>
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.
<p>
The kdm-specific option are configured by editing the file
"&dollar;KDEDIR/share/config/kdmrc". There are three sections in kdmrc:

<sect1>KDM

<p>
The keys in this section are
<tscreen><verb>
StdFont
FailFont
GreetFont
GreetString
SessionTypes
LogoPixmap
ShutdownButton
Shutdown
Restart
UserView
Users
NoUsers
SortUsers
GUIStyle
</verb></tscreen>

A short description of the keys:
<descrip>
<tag/*Font/ is a fontsstring formatted like this: Courier,12,5,iso-8859-1,50,0.

<tag/GreetString/ is the title of the kdm login window.

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

<tag/LogoPixmap/ Change this, if you dont like the logo.

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

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

<tag/Users/ is a ``;'' separated list of usernames that will be
displayed in the graphical user view. If <tt>UserView</tt> is 1 and the
<tt>Users </tt>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 ;-) 
<bf>NOTE:</bf> 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.

<tag/NoUsers/ is a ``;'' separated list of usernames that won't be
displayed. Use it to filter ``pseudo-users'' like <tt>sync</tt> and
<tt>shutdown</tt> from the user view.

<tag/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.

<tag/GUIStyle/ can be either <tt/Motif/ or <tt/Windows/.
</descrip>

<sect1>KDMDESKTOP
<p>
This section controls the background. The keys are:
<tscreen><verb> 
BackgroundPicture 
BackgroundColor1 
BackgroundColor2 
BackgroundPictureMode 
</verb></tscreen>

A short description of the keys: 
<descrip> 

<tag/BackgroundPicture/ is the path to an image. 
<p>
<tag/BackgroundColor[1|2]/ are named colors for solid and blended background. 
<p>
<tag/BackgroundPictureMode/ can contain one of the following options:
<p>
<tt>None | Tile | Scale | Center | TopLeft | TopRight | BottomLeft | BottomRight | Fancy</tt>
<p> 
Note that 
<tt>Fancy</tt> background looks nice, but is <bf>very</bf> slow.
</descrip> 
<p>
<sect1>Locale

<p>
This section should only contain one single entry.
<p>
<descrip>
<tag/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.
</descrip>
<p>
<sect>Legal stuff

<p>
Kdm is derived from xdm, so how is the copyright? Kdm 0.1 was done by
Matthias Ettrich. All later version by Steffen Hansen
<tt><htmlurl url="mailto:stefh@dit.ou.dk" name="stefh@dit.ou.dk"></tt>

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<tt><htmlurl
url="mailto:zumstein@ssd.ethz.ch" name="zumstein@ssd.ethz.ch"></tt>. Last
update is July, 9 1998
</article>
