<?xml version="1.0" ?>
<!DOCTYPE book PUBLIC "-//KDE//DTD DocBook XML V4.2-Based Variant V1.1//EN"
"dtd/kdex.dtd" [
  <!ENTITY kappname "&kdm;">
  <!ENTITY package "kdebase">
  <!ENTITY kdmrc "<filename>kdmrc</filename>">
  <!ENTITY ksmserver "<application>ksmserver</application>">
  <!ENTITY kdesktop "<application>kdesktop</application>">
  <!ENTITY XDMCP "<acronym>XDMCP</acronym>">
  <!ENTITY xdm "<application>xdm</application>">
  <!ENTITY kdmrc-ref SYSTEM "kdmrc-ref.docbook">
  <!ENTITY theme-ref SYSTEM "theme-ref.docbook">
  <!ENTITY % addindex "INCLUDE">
  <!ENTITY % English "INCLUDE" > <!-- change language only here -->
]>

<book id="kdm" lang="&language;">
<bookinfo>
<title>The &kdm; Handbook</title>

<authorgroup>
<author>
&Oswald.Buddenhagen; &Oswald.Buddenhagen.mail;
</author><!-- 
<othercredit role="developer">
&Oswald.Buddenhagen; &Oswald.Buddenhagen.mail;
<contrib>Developer</contrib>
</othercredit>
<othercredit role="reviewer">
&Lauri.Watts; &Lauri.Watts.mail;
<contrib>Reviewer</contrib>
</othercredit> -->

<!-- TRANS:ROLES_OF_TRANSLATORS -->

</authorgroup>

<copyright>
<year>2000</year>
<holder>&Neal.Crook;</holder>
</copyright>

<copyright>
<year>2002</year><year>2007</year>
<holder>&Oswald.Buddenhagen;</holder>
</copyright>

<copyright>
<year>2003</year>
<holder>&Lauri.Watts;</holder>
</copyright>

<legalnotice>&FDLNotice;</legalnotice>

<date>2007-12-07</date>
<releaseinfo>0.06.00</releaseinfo>

<abstract>
<para>This document describes &kdm; the &kde; Display Manager. &kdm;
is also known as the <quote>Login Manager</quote>.</para>
</abstract>

<keywordset>
<keyword>KDE</keyword>
<keyword>kdm</keyword>
<keyword>xdm</keyword>
<keyword>display manager</keyword>
<keyword>desktop manager</keyword>
<keyword>login manager</keyword>
</keywordset>
</bookinfo>

<!-- ********************************************************************** -->  
<chapter id="introduction">
<title>Introduction</title>

<para>&kdm; provides a graphical interface that allows you to log in to a
system. It prompts for login (username) and password, authenticates the user
and starts a <quote>session</quote>.  &kdm; is superior to &xdm;, the X
Display Manager, in a number of ways.</para>

</chapter>

<!-- Chapters to write -->
<!-- * Just enough config to get it to run and login to KDE 
     * Adding more session types (GNOME, etc)
     * Adding other customizations to XSession (ssh/gpg-agent, etc)
     * Further customization to KDM (via the kcontrol module, and by 
       hand)
     * XDMCP by query
     * XDMCP by broadcast
     * Sound transparency (if Ade can tell me how!)
     * Pull in all options from the KControl Module
     * More resources
-->

<chapter id="quickstart">
<title>Quick Start Guide</title>

<para>This is a quick start guide for users who fit the following
pattern:</para>

<itemizedlist>
<listitem>
<para>X is configured and works with the command
<command>startx</command> from the commandline.</para>
</listitem>
<listitem>
<para>Each user will generally only use a single window manager or
desktop environment, and does not change this choice very
often, or is comfortable editing a single text file in order to change
their choice.</para>
</listitem>
</itemizedlist>

<para>This scenario will be sufficient for many environments where a single
user or several users normally boot the computer and log into their
preferred environment.</para>

<procedure>
<title>Setting up a Default Session</title>
<step>
<para>Create or open the file <filename>~/.xinitrc</filename></para>
<para>If you already have a working <filename>~/.xinitrc</filename>, go to
the next step</para>
</step>
<step>
<para>If one does not already exist, add a line to the
<filename>~/.xinitrc</filename> to start your preferred window manager
or desktop environment.</para>
<para>For &kde; you should enter:</para>
<screen><userinput>startkde</userinput></screen>
<para>For other window managers or desktop environments, you should
look in their documentation for the correct command.</para>
</step>
<step><para>Make a link as follows:</para>
<screen><userinput><command>ln</command> <option>-s</option> <parameter>~/.xinitrc ~/.xsession</parameter></userinput></screen>
</step>
</procedure>

<para>At this point, typing <userinput><command>startx</command></userinput>
on the commandline should start X, with a &kde; session.  The next task is
to try &kdm;.</para>

<para>As <systemitem class="username">root</systemitem>, type
<userinput><command>kdm</command></userinput> at the prompt.</para>

<para>You should see a login window, which is described more fully in <xref
linkend="login" />.</para>

<para>Typing your normal username and password in the fields provided, and
leaving <option>default</option> selected as the session type should now
open a &kde; session for your user.</para>

<para>If you have other users to configure, you should repeat the procedure
above for each of them.</para>

<note>
<para>This is a quick guide to getting up and running only.  You probably
will want to customize &kdm; further, for example, to hide the names of the
system accounts, to allow further sessions, and much more.  Please read
through the rest of this manual to find out how to do these things.</para>
</note>

</chapter>

<chapter id="login"> 
<title>The Login Window</title> 

<para> The user interface to &kdm; consists of dialog boxes.  The main
dialog box contains:</para>
<itemizedlist>

<listitem>
<para>Widgets allowing you to authenticate. When the "classic" authentication
method is chosen, these are:</para>
<itemizedlist>

<listitem>
<para>A <guilabel>Username:</guilabel> field for you to enter your
username.</para>
</listitem>

<listitem>
<para>A <guilabel>Password:</guilabel> field for you to enter your
password.</para>
</listitem>

</itemizedlist>
</listitem>

<listitem>
<para>(Optionally) a list containing entries with the name and graphical
image of each user (for example, a digitized photograph).
Clicking a list entry is equivalent to typing the associated username
into the <guilabel>Username:</guilabel> field.</para>
</listitem>

<listitem>
<para>(Optionally) a region to the right of or above the
authentication area which can be used to display either a static image or an
analog clock.</para>
</listitem>

<listitem>
<para>A <guibutton>Login</guibutton> button that validates the
username/password combination and attempts to start a session of the
selected type.</para>
</listitem>

<listitem>
<para>A <guibutton>Menu</guibutton> button that opens an action menu
with the following items:</para>
<itemizedlist>

<listitem>
<para>(Optionally) A <guimenuitem>Session Type</guimenuitem> item
to choose the type of session (desktop environment, window manager) to start.
See <xref linkend="different-window-managers-with-kdm"/> to find out
how to configure different session types.</para>
</listitem>

<listitem>
<para>(Optionally) A <guimenuitem>Authentication Method</guimenuitem> item
to switch between different authentication methods like the classical
username+password, smartcard, biometry, &etc;.  The actual authenticators
are combinations of <acronym>PAM</acronym> modules and matching frontend
modules (<quote>conversation plugins</quote>). See
<xref linkend="option-pluginslogin"/>.</para>
</listitem>

<listitem>
<para>(Optionally on local displays) A
<guimenuitem>Switch User...</guimenuitem> item to switch between local
sessions running on different virtual terminals of this computer.</para>
</listitem>

<listitem>
<para>(Optionally on local displays) A
<guimenuitem>Restart X Server</guimenuitem> item
that terminates the currently running &X-Server;, starts a new one and
displays the login dialog again. You can use this if the display content
seems to be broken somehow.</para>
</listitem>

<listitem>
<para>(Optionally on remote displays) A
<guimenuitem>Close Connection</guimenuitem>
item that closes the connection to the &XDMCP; server you are currently
connected to. If you got to this server through a host chooser, this will
bring you back to the chooser, otherwise it will only reset the &X-Server;
and bring up the login dialog again.</para>
</listitem>

<listitem>
<para>(Optionally on local displays) A
<guimenuitem>Remote Login</guimenuitem> item that displays a host chooser
dialog with &XDMCP; servers one can log into remotely.</para>
</listitem>

<listitem>
<para>(Optionally on local displays) A <guimenuitem>Console Mode</guimenuitem>
item that terminates graphical login and leaves you at the console. See
<xref linkend="option-consolettys"/> and
<xref linkend="option-servertty"/>.</para>
</listitem>

<listitem>
<para>(Optionally) A <guimenuitem>Shutdown...</guimenuitem> item that displays
the <guilabel>Shutdown</guilabel> dialog box.</para>
</listitem>

</itemizedlist>
</listitem>

</itemizedlist>

<para>The <guilabel>Shutdown</guilabel> dialog box presents a set of
buttons that allow one of these actions to be executed:</para>

<variablelist>
<varlistentry>
<term>Turn Off Computer</term> 
<listitem>
<para>Shut the system down in a controlled manner, ready for
power-down.</para>
</listitem>
</varlistentry>
<varlistentry>
<term>Restart Computer</term>
<listitem>
<para>Shut the system down and reboot. For systems that use
<application>Lilo</application> or <application>Grub</application>,
an optional drop down box allows you to select a particular operating system
to be used for the reboot.</para>
</listitem>
</varlistentry>
<varlistentry>
<term>Schedule...</term> 
<listitem>
<para>If this option is enabled, you may use it to enter a more complex
shutdown dialog. See <xref linkend="option-scheduledsd"/> for details.</para>
</listitem>
</varlistentry>
</variablelist>

<para>Pressing the <guibutton>Cancel</guibutton> button returns to the
main &kdm; dialog box. </para>

</chapter>

<!-- *********************************************************************** -->
<chapter id="configuring-kdm">
<title>Configuring &kdm;</title>

<para>This chapter assumes that &kdm; is already up and running on your
system, and that you simply want to change its behavior in some way.</para>

<para>When &kdm; starts up, it reads its configuration from the folder
<filename class="directory">$<envar>KDEDIR</envar>/share/config/kdm/</filename>
(this may
be <filename class="directory">/etc/kde4/kdm/</filename> or something else
on your system).</para>

<para>The main configuration file is &kdmrc;; all other files are
referenced from there and could be stored under any name anywhere on
the system - but usually that would not make much sense for obvious
reasons (one particular exception is referencing configuration files
of an already installed &xdm; - however when a new &kdm; is installed,
it will import settings from those files if it finds an already installed
&xdm;).</para>

<para>Since &kdm; must run before any user is logged in, it is not
associated with any particular user. Therefore, it is not possible to have
user-specific configuration files; all users share the common &kdmrc;.  It
follows from this that the configuration of &kdm; can only be altered by
those users that have write access to
<filename>$<envar>KDEDIR</envar>/share/config/kdm/kdmrc</filename> (normally
restricted to system administrators logged in as <systemitem
class="username">root</systemitem>).</para>

<para>You can view the &kdmrc; file currently in use on your system, and you
can configure &kdm; by editing this file. Alternatively, you can use the
graphical configuration tool provided by the &systemsettings; (the 
<guilabel>Login Screen</guilabel> module in the <guilabel>System Administration</guilabel> category).
</para>

<para>The remainder of this chapter describes configuration of &kdm;
via the &systemsettings; module, and the <link linkend="kdm-files">next
chapter</link> describes the options available in &kdmrc; itself. If
you only need to configure for local users, the &systemsettings; module
should be sufficient for your needs.  If you need to configure remote
logins, or have multiple &kdm; sessions running, you will need to read
on.</para>

<!-- this sect is up to date for 4.4-->
<sect1 id="kdm-kcontrol-module">
<sect1info>
<authorgroup>
<author>&Thomas.Tanghus; &Thomas.Tanghus.mail;</author>
<author>&Steffen.Hansen; &Steffen.Hansen.mail;</author>
<author>&Mike.McBride; &Mike.McBride.mail;</author>
</authorgroup>
</sect1info>

<title>The Login Manager &systemsettings; Module</title>

<para>Using this module, you can configure the &kde; graphical login
manager, &kdm;.  You can change how the login screen looks, who has
access using the login manager and who can shutdown the
computer.</para>

<note><para>All settings will be written to the configuration file
&kdmrc;, which in its original state has many comments to help you
configure &kdm;.  Using this &systemsettings; module will strip these
comments from the file.  All available options in &kdmrc; are covered
in <xref linkend="kdm-files"/>.</para>

<para>The options listed in this chapter are cross referenced with
their equivalents in &kdmrc;. All options available in the &systemsettings;
module are also available directly in &kdmrc; but the reverse is not
true.</para></note>

<para>In order to organize all of these options, this module is
divided into several sections: <link
linkend="kdmconfig-general"><guilabel>General</guilabel></link>,
<link linkend="kdmconfig-dialog"><guilabel>Dialog</guilabel></link>, <link
linkend="kdmconfig-background"><guilabel>Background</guilabel></link>,
<link
linkend="kdmconfig-theme"><guilabel>Theme</guilabel></link>,
<link
linkend="kdmconfig-shutdown"><guilabel>Shutdown</guilabel></link>,
<link linkend="kdmconfig-users"><guilabel>Users</guilabel></link> and
<link
linkend="kdmconfig-convenience"><guilabel>Convenience</guilabel></link>.</para>

<para>You can switch between the sections using the tabs at the top of
the window.</para>

<note><para>You can only make changes if you run this module with superuser rights.</para></note>

<sect2 id="kdmconfig-general">
<title>General</title>

<para>First you have a drop down box to choose the language for
your login box, corresponding to setting <option>Language</option> in
&kdmrc;.</para>

<para>In the <guilabel>Appearance</guilabel> section you have an option to use 
&kdm; in themed mode. If <guilabel>Use themed greeter</guilabel> is checked, 
the settings on the <guilabel>Dialog</guilabel> and <guilabel>Background</guilabel> 
pages cannot be configured separately.</para>

<para>While &kde;'s style depends on the settings of the user logged
in, the style used by &kdm; can be configured using the <guilabel>GUI
style:</guilabel> and <guilabel>Color scheme:</guilabel> options.
These correspond to the keys <link
linkend="option-guistyle"><option>GUIStyle</option></link> and <link
linkend="option-colorscheme"><option>ColorScheme</option></link> in
&kdmrc; respectively.</para>

<para>From the <guilabel>Fonts</guilabel> section of this page you can change the fonts used in the
login window.  Only fonts available to all users are available here, not
fonts you have installed on a per user basis.</para>

<para>You can select three different font styles in this section
(<guilabel>General:</guilabel>, <guilabel>Failure:</guilabel>,
<guilabel>Greeting:</guilabel>).  When you click on the
<guibutton>Choose...</guibutton> button a dialog appears from which you can
select the new characteristics for the font style.</para>

<itemizedlist>
<listitem>
<para>The <guilabel>General:</guilabel> font is used in all other places in the
login window.</para>
</listitem>
<listitem>
<para>The <guilabel>Failure:</guilabel> font is used when a login
fails.</para>
</listitem>
<listitem>
<para>The <guilabel>Greeting:</guilabel> font is the font used for the title
(Greeting String).</para>
</listitem>
</itemizedlist>

<para>You can also check the box labeled <guilabel>Use anti-aliasing for
fonts</guilabel> if you want smoothed fonts in the login dialog.</para>

</sect2>

<sect2 id="kdmconfig-dialog">
<title>Dialog</title>

<para>From this page you can change the visual appearance of &kdm;,
&kde;'s graphical login manager in non themed mode.</para>

<para>The <guilabel>Greeting:</guilabel> is the title of the login
 screen.  Setting this is especially useful if you have many servers users
 may log in to.  You may use various placeholders, which are described
 along with the corresponding key
 <link linkend="option-greetstring"><option>GreetString</option></link>
 in &kdmrc;.
</para>

<para>You can then choose to show either the current system time, a logo or
nothing special in the login box.  Make your choice in the radio buttons
labeled <guilabel>Logo area:</guilabel>. This corresponds to <link
linkend="option-logoarea"><option>LogoArea</option></link> in &kdmrc;</para>

<para>If you chose <guilabel>Show logo</guilabel> you can now choose a
logo:</para>

<itemizedlist>
<listitem>
<para>Drop an image file on the image button.</para>
</listitem>
<listitem>
<para>Click on the image button and select a new image from the image chooser
dialog.</para>
</listitem>
</itemizedlist>

<para>If you do not specify a logo, the default
<filename>$<envar>KDEDIR</envar>/share/apps/kdm/pics/kdelogo.xpm</filename>
will be displayed.</para>

<para>Normally the login box is centered on the screen.  
Drag the anchor to move the center of the dialog to the desired position. 
Keyboard control is possible as well: Use the arrow keys or <keycap>Home</keycap> to center. 
Note that the actual proportions of the dialog are probably different.
These correspond to the key
<link linkend="option-greeterpos"><option>GreeterPos</option></link>
in &kdmrc;.</para>

</sect2>

<sect2 id="kdmconfig-background">
<title>Background</title>

<para>Here you can change the desktop background which will be displayed
before a user logs in. Selecting <guilabel>Enable background</guilabel>
allows you to edit the options on this tab.</para>

<para>This tab is comprised of three areas:</para>

<orderedlist>
<listitem>
<para>An area for selecting background images</para>
</listitem>
<listitem>
<para>The background Preview Monitor</para>
</listitem>
<listitem>
<para>An area for determining the background color</para>
</listitem>
</orderedlist>

<variablelist>
<varlistentry>
<term>Preview Monitor</term>
<listitem>
<para>This is a preview window.  It will give you a sense of what to
expect with each change.</para>
</listitem>
</varlistentry>

<varlistentry>
<term><guilabel>Background</guilabel></term>
<listitem>
<para>This section allows you to load a wallpaper on top of the color
gradient chosen in the section below.</para>

<para>There are three choices available here:</para>

<variablelist>
<varlistentry>
<term><guilabel>No Picture</guilabel></term>
<listitem>
<para>No picture background will be shown.  The color and pattern
choices below will still take effect.</para>
</listitem>
</varlistentry>

<varlistentry>
<term><guilabel>Picture</guilabel></term>
<listitem>
<para>A single picture will be used as the background for the selected
desktops.</para>
<para>How this picture is positioned and scaled can be fine tuned
below.</para>
</listitem>
</varlistentry>

<varlistentry>
<term><guilabel>Slide show</guilabel></term>
<listitem>
<para>&kde; allows you to have an automatic slide show of wallpaper
images. To enable this option, press the <guibutton>Setup...</guibutton>
button.  In the resulting dialog you may choose any
image or folder of images available on your computer, using the
<guibutton>Add...</guibutton> button to navigate your file system.
<guibutton>Remove</guibutton> will remove the currently selected
entry from the list.</para>

<para>You may choose the length of time any image is displayed in the
<guilabel>Change picture after:</guilabel> box, and you may choose
<guibutton>Show pictures in random order</guibutton> if you don't want
them displayed in the order they are listed.</para>

<tip><para>Displaying wallpaper requires that the image be kept in
memory.  If you are low on memory, using a small, tiled image or none
at all is recommended.</para>

<para>Scaling or centering a small image still requires an image the
size of your display to be maintained in memory.</para></tip>
</listitem>
</varlistentry>
</variablelist>
</listitem>
</varlistentry>

<varlistentry>
<term><guilabel>Options</guilabel></term>
<listitem>

<variablelist><!-- Positioning -->
<title><guilabel>Position:</guilabel></title>
<varlistentry>
<term>Centered</term>
<listitem><para>The image will be centered on the screen without changing the
size of the image.  The background colors will be present anywhere the image
does not cover.</para> </listitem>
</varlistentry>
<varlistentry>
<term>Tiled</term>
<listitem><para>The image will be duplicated until it fills the entire
desktop. The first image will be placed in the upper left corner of the screen,
and duplicated downward and to the right.</para></listitem>
</varlistentry>
<varlistentry>
<term>Center Tiled</term>
<listitem><para>The image will be duplicated until it
fills the entire desktop. The first image will be placed in the center of the
screen, and duplicated upward, downward to the right, and to the left.</para>
</listitem></varlistentry>
<varlistentry>
<term>Centered Maxpect</term>
<listitem><para>The image will be placed in the center of the screen.  It will
be scaled to fit the desktop, but it will not change the aspect ratio of the
original image.  This will provide you with an image that is not distorted.
</para></listitem>
</varlistentry>
<varlistentry>
<term>Tiled Maxpect</term>
<listitem>
<para>The image will be placed in the corner of the screen.  It will
be scaled to fit the desktop, but it will not change the aspect ratio
of the original image.  This will provide you with an image that is
not distorted.  If there is any space over, the image will be
duplicated to fill it.  </para>
</listitem>
</varlistentry>
<varlistentry>
<term>Scaled</term>
<listitem><para>The image will be scaled to fit the desktop.  It will be
stretched to fit to all four corners.  This may distort the image.</para></listitem>
</varlistentry>
<varlistentry>
<term>Centered Auto fit</term>
<listitem>
<para>If the picture fits the desktop size, this mode works like the
centered option. If the picture is larger than the desktop then it is
scaled down to fit while keeping the aspect ratio.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>Scale &amp; Crop</term>
<listitem>
<para>Magnify the picture without distorting it until it fills both the
width and height of the desktop (cropping the picture if necessary), and
then center it on the desktop.</para>
</listitem>
</varlistentry>
</variablelist>

<variablelist><!-- Colors -->
<varlistentry>
<term><guilabel>Colors:</guilabel></term>
<listitem>
<para>The first drop down box allows you to choose the type of color,
gradient, or pattern to display under (or in place of) wallpaper.</para>
<tip><para>If you are going to be using a picture as a wallpaper, you
can skip this section of the dialog box.</para>
<para>However, if your chosen wallpaper does not cover the entire
desktop, the chosen colors will still show in the remaining
space.</para></tip>

<variablelist>
<varlistentry>
<term><guilabel>Single Color</guilabel></term>
<listitem><para>By choosing this mode, you select one color using the
first color bar, and the entire background is covered with this one
color.</para></listitem>
</varlistentry>
<varlistentry>
<term><guilabel>Horizontal Gradient</guilabel></term>
<listitem><para>By choosing this mode, you select two colors (using both color
buttons).  &kde; will then start with the primary color selected with the left 
button on the left edge of the screen, and slowly transform into the blend color
selected with the right button by the time it gets to the
right edge of the screen.</para></listitem>
</varlistentry>
<varlistentry>
<term><guilabel>Vertical Gradient</guilabel></term>
<listitem><para>By choosing this mode, you select two colors (using both color
buttons).  &kde; will then start with the primary color selected with the left
button on the top edge of the screen, and slowly transform into the blend color
selected with the right button as it moves to the bottom of
the screen.</para></listitem>
</varlistentry>
<varlistentry>
<term><guilabel>Pyramid Gradient</guilabel></term>
<listitem><para>By choosing this mode, you select two colors (using both color
buttons).  &kde; will then start with the primary color selected with the left
button in each corner of the screen, and slowly transform into the blend color
selected with the right button as it moves to the center of the
screen.</para></listitem>
</varlistentry>
<varlistentry>
<term><guilabel>Pipecross Gradient</guilabel></term>
<listitem><para>By choosing this mode, you select two colors (using both color
buttons).  &kde; will then start with the primary color selected with the left
button in each corner of the screen, and slowly transform into the blend color
selected with the right button as it moves to the center of the screen. 
The shape of this gradient is different than the pyramid gradient.</para></listitem>
</varlistentry>
<varlistentry>
<term><guilabel>Elliptic Gradient</guilabel></term>
<listitem><para>By choosing this mode, you select two colors (using both color
buttons).  &kde; will then start with the blend color selected with the right
button in the center of the screen, and slowly
transform into the primary color selected by the left button 
as it moves to the edges, in an elliptical pattern.</para></listitem>
</varlistentry>

<varlistentry>
<term><replaceable>Pattern</replaceable></term>
<listitem>
<para>The rest of the list are the names of various patterns
or textures you can choose.</para>
<para>For more on patterns, see
the section <link linkend="bkgnd-patterns">Adding, Removing and
Modifying Patterns</link>.</para>

<para>Select the primary color with the first color bar.  If you have
chosen a pattern that requires two colors to be set the secondary
color can be set by pressing the appropriate button.</para>
</listitem>
</varlistentry>
</variablelist>

</listitem>
</varlistentry>
</variablelist>

<variablelist>
<varlistentry>
<term><guilabel>Blending:</guilabel></term>
<listitem>
<para>The drop down box labeled <guilabel>Blending:</guilabel> contains the
options to make a smooth transition (blend) from the wallpaper as it
changes to the background.</para>

<orderedlist>
<listitem><para>A drop down box allows you to select the blending mode.
Many of the modes are similar to blending modes for background colors.  Select
your mode from the list, and the preview window shows you what it will look
like.</para></listitem>
<listitem><para>The <guilabel>Balance</guilabel> slider adjusts the
blending.  The results can be seen immediately in the preview
window.</para></listitem>
<listitem><para>The <guilabel>Reverse roles</guilabel> can reverse the
role of the picture and the background for some types of
blending.</para>
</listitem>
</orderedlist>
</listitem>
</varlistentry>
</variablelist>
</listitem>
</varlistentry>
</variablelist>

<sect3 id="bkgnd-advanced">
<title>Advanced options</title>
<para>Located below the preview monitor is a button labeled
<guibutton>Advanced Options</guibutton>.</para>

<para>To use an external program to determine and change the
background of &kde;, simply select <guilabel>Use the following program
for drawing the background</guilabel>.  Available &kde; programs are
listed, select one to enable it.</para>

<!--Not in 4.4
<para>To add a third party application (&eg;
<application>XEarth</application>) you may use the
<guibutton>Add...</guibutton> button.  A dialog will open allowing you
to choose your application, and fill in other data about it.  You may
remove any entries from this list by selecting it and pressing the
<guibutton>Remove</guibutton> button.</para>

<para>Using third party external programs to modify or change the
background is beyond the scope of this document, see their respective
documentation for the format of command-line switches and other
configuration information.</para>

<para>Also in this section you may choose to set the color of text
that is used for icons on the desktop.  If you find icon text
difficult to read against a wallpaper or pattern, you can choose a
solid color to show beneath text, or enable a shadow under the text to
enhance its appearance.</para>

<para>It is possible to set how many lines of text will be shown beneath each icon with the <guilabel>Lines for icon text:</guilabel>   If the text is longer than can be shown in the configured number of lines, it will be truncated.  You can also set a value for the <guilabel>Width for icon text:</guilabel> option.  The value is in pixels, and the default is <guilabel>Auto</guilabel>, which is a default calculated based on the current font.
</para>

<para>Finally you can set the <guilabel>Size of the background
cache:</guilabel>.  The default (2048 KB) is usually a safe
choice.</para>
-->
</sect3>

<sect3 id="bkgnd-patterns">
<title>Adding, Removing and Modifying Wallpapers and Patterns</title>

<para>There is a button under the preview monitor labeled <guibutton>Get
New Wallpapers</guibutton> that helps you fetch new wallpaper images from a
selection of popular images from the <ulink
url="http://www.kde-look.org">KDE-Look</ulink> website.  You can of course
select any image you have available to use as wallpaper, and it may be
stored in any location on your hard drive.  To have a wallpaper show up in
the list automatically for all users, you should save it to the <filename
class="directory">$<envar>KDEDIR</envar>/share/wallpapers</filename>
folder.</para>

<para>A pattern is a picture file which &kde; uses as a template to
draw your background.  The picture file provides the shapes, but &kde;
provides the colors.  &kde; is packaged with several patterns, and you also
can add new patterns.</para>

<para>To add a new pattern that is available to every user on your
computer, simply place the file in <filename
class="directory">$<envar>KDEDIR</envar>/share/apps/kdm/patterns/</filename>.</para>

<para>Copy a <literal role="extension">.desktop</literal> file from
this folder, and name it the same as your new pattern image file.
Modify the contents to suit your new pattern.</para>

<para>To add a new pattern for a single user, add the files to
<filename
class="directory">$<envar>KDEHOME</envar>/share/apps/kdm/patterns/</filename>.</para>

<para>For best results, the pattern should be a grayscale PNG file.</para>

</sect3>

</sect2>

<sect2 id="kdmconfig-theme">
<title>Theme</title>
<para>This page consists of three sections:</para>

<para>A list of installed themes, where you can select the one to be used.</para>

<para>A screenshot with a preview of the selected theme and additional 
information like <guilabel>Copyright</guilabel> and <guilabel>Description</guilabel>.</para>

<para>Three buttons to install or remove a theme and a button to launch
the <guilabel>Get Hot New Stuff</guilabel> dialog where you can download new themes.</para>

<note><para>The settings on this page are only available in themed mode.</para></note>

</sect2>

<sect2 id="kdmconfig-shutdown">
<title>Shutdown</title>

<para><guilabel>Allow Shutdown</guilabel></para>
<para>Use this drop down box to choose who is allowed to shut down:</para>
<itemizedlist>
<listitem>
<para><guilabel>Nobody</guilabel>: No one can shutdown the computer using
&kdm;.  You must be logged in, and execute a command.</para>
</listitem>
<listitem>
<para><guilabel>Everybody</guilabel>:  Everyone can shutdown the computer using
&kdm;.</para>
</listitem>
<listitem><para><guilabel>Only Root</guilabel>: &kdm; requires that the
<systemitem>root</systemitem> password be entered before shutting down the
computer.</para></listitem> 
</itemizedlist>

<para>You can independently configure who is allowed to issue a
shutdown command for the <guilabel>Local:</guilabel> and
<guilabel>Remote:</guilabel> users.</para>

<para><emphasis>Commands</emphasis></para> <para>Use these text fields to
define the exact shutdown command.</para> <para>The
<guilabel>Halt:</guilabel> command defaults to <!-- Are these defaults still
correct? they disagree with what's in --> <!-- kdmrc -->
<command>/sbin/halt</command>.  The <guilabel>Reboot:</guilabel> command
defaults to
<command>/sbin/reboot</command>.</para>

<para>When <guilabel>Boot manager</guilabel> is set to <guilabel>Grub</guilabel> 
or <guilabel>Lilo</guilabel>, &kdm;
will on reboot offer you options for these boot managers. Note that this
option is not available on all operating systems.</para>

</sect2>

<sect2 id="kdmconfig-users">
<title>Users</title>

<para>From here you can change the way users are represented in the
login window.</para>

<para>Independently of the users you specify by name, you can use the
<guilabel>System UIDs</guilabel> to specify a range of valid
<acronym>UID</acronym>s that are shown in the list.  By default user
id's under 1000, which are often system or daemon users, and user id's
over 30000, are not shown.</para>

<para>You may disable the user list in &kdm; entirely in the
<guilabel>Users</guilabel> section.  You can choose from:</para>

<variablelist>
<varlistentry>
<term><guilabel>Show list</guilabel></term>
<listitem>
<para>Only show users you have specifically not excluded in the list
alongside</para>
<para>If you do not check this box, no list will be shown. This is the most secure setting, since an
attacker would then have to guess a valid login name as well as a
password. It is also the preferred option if you have more than a
handful of users to list, or the list itself would become
unwieldy.</para>
</listitem>
</varlistentry>
<varlistentry>
<term><guilabel>Autocompletion</guilabel></term>
<listitem>
<para>If this option is checked, &kdm; will automatically complete user names while 
they are typed in the line edit.</para>
</listitem>
</varlistentry>
<varlistentry>
<term><guilabel>Inverse selection</guilabel></term>
<listitem>
<para>Allows you to instead select a list of users that should
be shown, and all other users will <emphasis>not</emphasis> be
listed.</para>
</listitem>
</varlistentry>
</variablelist>

<para>You can also enable the <guilabel>Sort users</guilabel>
checkbox, to have the user list sorted alphabetically.  If this is
disabled, users will appear in the order they are listed in the
password file.  &kdm; will also autocomplete user names if you enable the
<guilabel>Autocompletion</guilabel> option.</para>

<para>If you choose to show users, then the login window will show
images (which you select), of a list of users.  When someone is ready
to login, they may select their user name/image, enter their password,
and they are granted access.</para>

<para>If you permit a user image, then you can configure the <guilabel>
User Image Source</guilabel>:</para>

<para>Here you can specify where &kdm; will obtain the images that represent users. 
<guilabel>System</guilabel> represents the global folder; these are the pictures you can set 
below. <guilabel>User</guilabel> means that &kdm; should read the user's 
<filename>$<envar>HOME</envar>/.face.icon</filename> file. 
The two selections in the middle define the order of preference if both 
sources are available.
</para>

<para>If you choose not to show users, then the login window will be
more traditional.  Users will need to type their username and password
to gain entrance.  This is the preferred way if you have many users on
this terminal.</para>

</sect2>

<sect2 id="kdmconfig-convenience">
<title>Convenience</title>

<para>In the <guilabel>Convenience</guilabel> tab you can configure
some options that make life easier for lazy people, like automatic
login or disabling passwords.</para>

<important><para>Please think more than twice before using these
options. Every option in the <guilabel>Convenience</guilabel> tab is
well-suited to seriously compromise your system security. Practically,
these options are only to be used in a completely non-critical
environment, &eg; a private computer at home.  </para></important>

<sect3 id="loginmanager-convenience-autologin">
<title>Automatic Login</title>

<para>Automatic login will give anyone access to a certain account on
your system without doing any authentication.  You can enable it using
the option <guilabel>Enable Auto-Login</guilabel>.</para>

<para>You can choose the account to be used for automatic login from
the list labeled <guilabel>User:</guilabel>.</para>

<para>With <guilabel>Lock session</guilabel> the automatically started session 
will be locked immediately (provided it is a &kde; session). This can be used 
to obtain a super-fast login restricted to one user.</para>

<!-- is this true?-->
<para>Automatic login can be suppressed by pressing the &Shift; key immediately
after the &X-Server; switches to graphics mode and releasing it when &kdm;'s
hourglass cursor appears.</para>
</sect3>

<sect3 id="loginmanager-convenience-preselecteduser">
<title><guilabel>Preselected User</guilabel></title>

<para>You can also choose which user is <quote>preselected</quote>
when &kdm; starts. The default is <guilabel>None</guilabel>, but you
can choose <guilabel>Previous</guilabel> to have &kdm; default to the
last successfully logged in user, or you can
<guilabel>Specify</guilabel> a particular user to always be selected
from the list.  You can also have &kdm; set the focus to the password
field, so that when you reach the &kdm; login screen, you can type the
password immediately.</para>

</sect3>

<sect3 id="loginmanager-convenience-nopasswd">
<title><guilabel>Password-Less Login</guilabel></title>

<para>Using this feature, you can allow certain users to login without
having to provide their password. Enable this feature using the
<guilabel>Enable Password-Less Logins</guilabel> option.</para>

<para>Below this option you'll see a list of users on the system.
Enable password-less login for specific users by checking the checkbox
next to the login names.  By default, this feature is disabled for
all users.</para>

<important><para>Again, this option should only be used in a safe
environment. If you enable it on a rather public system you should
take care that only users with heavy access restrictions are granted
password-less login, &eg;
<systemitem>guest</systemitem>.</para></important>

<para>The <guilabel>Automatically login after X server crash</guilabel>
option allows you to skip the authentication procedure when your X
server accidentally crashed.</para>

</sect3>

</sect2>

</sect1>

</chapter>

&kdmrc-ref;

&theme-ref;

<!-- ************************************************************ -->   
<chapter id="configuring-your-system-for-kdm">
<title>Configuring your system to use &kdm;</title>

<para>This chapter assumes that your system is already configured to
run the &X-Window;, and that you only need to reconfigure it to
allow graphical login.</para>

<sect1 id="setting-up-kdm">
<title>Setting up &kdm;</title>

<para>The fundamental thing that controls whether your computer boots to a
terminal prompt (console mode) or a graphical login prompt is the default
runlevel.  The runlevel is set by the program <application> <ulink
url="man:init">/sbin/init</ulink></application> under the control of the
configuration file <filename>/etc/inittab</filename>. The default runlevels
used by different &UNIX; systems (and different &Linux; distributions) vary,
but if you look at <filename>/etc/inittab</filename> the start of it should
be something like this:</para>

<screen># Default runlevel. The runlevels used by RHS are:
# 0 - halt (Do NOT set initdefault to this)
# 1 - Single user mode
# 2 - Multiuser, without NFS
# 3 - Full multiuser mode
# 4 - unused
# 5 - X11
# 6 - reboot (Do NOT set initdefault to this)

id:3:initdefault:  
</screen>

<para>All but the last line of this extract are comments. The comments
show that runlevel 5 is used for X11 and that runlevel 3 is used for
multi-user mode without X11 (console mode). The final line specifies
that the default runlevel of the system is 3 (console mode). If your
system currently uses graphical login (for example, using &xdm;) its
default runlevel will match the runlevel specified for X11.</para>

<para>The runlevel with graphical login (&xdm;) for some common &Linux;
distributions is:</para>

<itemizedlist>
<listitem><para>5 for &RedHat; 3.x and later, and for &Mandrake;</para></listitem>
<listitem><para>4 for Slackware</para></listitem>
<listitem><para>3 for &SuSE;. 4.x and 5.x</para></listitem>
</itemizedlist>

<para>The first step in configuring your system is to ensure that you
can start &kdm; from the command line. Once this is working, you can
change your system configuration so that &kdm; starts automatically
each time you reboot your system.</para>

<para>To test &kdm;, you must first bring your system to a runlevel
that does not run &xdm;. To do so, issue a command like this:</para>

<screen><command>/sbin/init <option>3</option></command></screen>

<para>Instead of the number <option>3</option> you should specify the
appropriate runlevel for console mode on your system.</para>

<para>If your system uses Pluggable Authentication Modules
(<abbrev>PAM</abbrev>), which is normal with recent &Linux; and &Solaris;
systems, you should check that your <abbrev>PAM</abbrev> configuration permits
login through the service named <literal>kde</literal>. If you previously used
&xdm; successfully, you should not need to make any
changes to your <abbrev>PAM</abbrev> configuration in order to use
&kdm;. <filename>/etc/pam.conf</filename> or
<filename>/etc/pam.d/kde</filename>. Information on configuring
<abbrev>PAM</abbrev> is beyond the scope of this handbook, but
<abbrev>PAM</abbrev> comes with comprehensive documentation (try looking in
<filename>/usr/share/doc/*pam*/html/</filename>).</para>

<para>Now it's time for you to test &kdm; by issuing the following
command:</para>

<screen><command>kdm <option>-nodaemon</option></command>
</screen>

<para>If you get a &kdm; login dialog and you are able to log in,
things are going well.  The main thing that can go wrong here is that
the run-time linker might not find the shared &Qt; or &kde; libraries.
If you have a binary distribution of the &kde; libraries, make sure
&kdm; is installed where the libraries believe &kde; is installed and
try setting some environment variables to point to your &kde; and &Qt;
libraries.</para>

<para>For example:</para>

<screen><command>export 
<option>KDEDIR=<replaceable>/opt/kde</replaceable></option></command>
<command>export 
<option>QTDIR=<replaceable>/usr/lib/qt4</replaceable></option></command>
<command>export 
<option>PATH=<replaceable>$KDEDIR/bin:$QTDIR/bin:$PATH</replaceable></option></command>
<command>export 
<option>LD_LIBRARY_PATH=<replaceable>$KDEDIR/lib:$QTDIR/lib</replaceable></option></command>
</screen>

<para>If you are still unsuccessful, try starting &xdm; instead, to
make sure that you are not suffering from a more serious X
configuration problem.</para>

<para>When you are able to start &kdm; successfully, you can start to
replace &xdm; by &kdm;. Again, this is distribution-dependent.</para>

<itemizedlist>
<listitem>
<para>For &RedHat;, edit <filename>/etc/inittab</filename>, look for this
 line:</para>
<screen>x:5:respawn:/usr/X11/bin/xdm -nodaemon</screen>
<para>and replace with:</para>
<screen>x:5:respawn:/opt/kde/bin/kdm</screen>
<para>This tells <command>init</command>(8) to respawn &kdm; when the
system is in run level 5. Note that &kdm; does not need the
 <option>-nodaemon</option> option.</para>
</listitem>
<listitem>
<para>For &Mandrake;, the X11 runlevel in
<filename>/etc/inittab</filename> invokes the shell script
<filename>/etc/X11/prefdm</filename>, which is set up to select from
amongst several display managers, including &kdm;. Make sure that all
the paths are correct for your installation.</para> 
</listitem>
<listitem>
<para>For &SuSE;, edit <filename>/sbin/init.d/xdm</filename> to add a
first line:</para>

<screen>. /etc/rc.config
DISPLAYMANAGER=kdm
export DISPLAYMANAGER</screen>
</listitem>
<listitem><para>For FreeBSD, edit <filename>/etc/ttys</filename> and find
the line like this:</para>
<screen>ttyv8   "/usr/X11R6/bin/xdm -nodaemon"  xterm   off secure</screen>
<para>and edit it to this:</para>
<screen>ttyv8   "/opt/kde/bin/kdm"  xterm   on secure</screen>
</listitem>

<listitem><para>Most other distributions are a variation of one of
these.</para></listitem>
</itemizedlist>

<para>At this stage, you can test &kdm; again by bringing your system
to the runlevel that should now run &kdm;. To do so, issue a command
like this:</para>

<screen><command>/sbin/init <option>5</option></command>
</screen>

<para>Instead of the number <option>5</option> you should specify the
appropriate runlevel for running X11 on your system.</para>

<para>The final step is to edit the <parameter>initdefault</parameter>
entry in <filename>/etc/inittab</filename> to specify the appropriate
runlevel for X11.</para>

<warning><para>Before you make this change, ensure that you have a way
to reboot your system if a problem occurs. This might be a
<quote>rescue</quote> floppy-disk provided by your operating system
distribution or a specially-designed <quote>rescue</quote>
floppy-disk, such as <literal>tomsrtbt</literal>. Ignore this advice
at your peril.</para></warning>

<para>This usually involves changing the line:</para>
<screen>id:3:initdefault:</screen>
<para>to</para>
<screen>id:5:initdefault:</screen>

<para>When you reboot your system, you should end up with the
graphical &kdm; login dialog.</para>

<para>If this step is unsuccessful the most likely problem is that the
environment used at boot time differs from the environment that you used for
testing at the command line.  If you are trying to get two versions of &kde;
to co-exist, be particularly careful that the settings you use for your
<envar>PATH</envar> and <envar>LD_LIBRARY_PATH</envar> environment variables
are consistent, and that the startup scripts are not over-riding them in
some way.</para>

</sect1>

</chapter>

<chapter id="different-window-managers-with-kdm">
<title>Supporting multiple window managers</title>

<para>&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 <guimenuitem>Session Type</guimenuitem> submenu.</para>

<para>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 <envar>PATH</envar> and has not been renamed by the distributor
into something unexpected.</para>

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

<para>The session types are defined by <firstterm>.desktop</firstterm> files
located in the directories listed in <link
linkend="option-sessionsdirs"><option>SessionsDirs</option></link>. The
last named directory contains the system-provided default session types
and is <filename
class="directory">$<envar>KDEDIR</envar>/share/apps/kdm/sessions</filename>
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 <filename
class="directory">$<envar>KDEDIR</envar>/share/config/kdm/sessions</filename>
in an installation from source, but distributors often change it to something
like <filename class="directory">/etc/kde4/kdm/sessions</filename>.
You can simply add an appropriately named <literal
role="extension">.desktop</literal> files here. The fields are:</para>

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

<para>There are also three <quote>magic</quote> types:</para>

<variablelist>
<varlistentry>
<term>default</term>
<listitem>
<para>
The default session for &kdm; is normally &kde; but can be configured by the
system administrator.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>custom</term>
<listitem>
<para>
The Custom session will run the user's ~/.xsession if it exists, falling
back to the default session otherwise.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>failsafe</term>
<listitem>
<para>
Failsafe will run a very plain session, and is useful only for debugging
purposes.
</para>
</listitem>
</varlistentry>
</variablelist>

<para>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 <quote>shadowing</quote> 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.</para>

</chapter>

<chapter id="xdmcp-with-kdm">
<title>Using &kdm; for Remote Logins (&XDMCP;)</title>

<para>&XDMCP; is the Open Group standard, the <quote>X Display Manager
Control Protocol</quote>.  This is used to set up connections between
remote systems over the network.</para>

<para>&XDMCP; is useful in multiuser situations where there are users
with workstations and a more powerful server that can provide the
resources to run multiple X sessions.  For example, &XDMCP; is a good
way to reuse old computers - a Pentium or even 486 computer with 16 Mb
RAM is sufficient to run X itself, and using &XDMCP; such a computer can
run a full modern &kde; session from a server.  For the server part,
once a single &kde; (or other environment) session is running, running
another one requires very few extra resources.</para>

<para>However, allowing another method of login to your machine
obviously has security implications.  You should run this service only
if you need to allow remote X Servers to start login sessions on your
system. Users with a single &UNIX; computer should not need to run
this.</para>

</chapter>

<chapter id="advanced-topics">
<title>Advanced Topics</title>

<sect1 id="command-sockets">
<title>Command Sockets</title>

<para>This is a feature you can use to remote-control &kdm;. It's mostly
intended for use by &ksmserver; and &kdesktop; from a running session, but
other applications are possible as well.</para>

<para>The sockets are &UNIX; domain sockets which live in subdirectories of the
directory specified by <option>FifoDir</option>=. The subdir is the key to
addressing and security; the sockets all have the file name
<filename>socket</filename> and file permissions
<literal>rw-rw-rw-</literal> (0666). This is because some systems don't care
for the file permission of the socket files.</para>

<para>There are two types of sockets: the global one (dmctl) and the
per-display ones (dmctl-&lt;display&gt;).</para>

<para>The global one's subdir is owned by root, the subdirs of the per-display
ones' are owned by the user currently owning the session (root or the
logged in user). Group ownership of the subdirs can be set via FifoGroup=,
otherwise it's root. The file permissions of the subdirs are rwxr-x---
(0750).</para>

<para>The fields of a command are separated by tabs (<token>\t</token>), the
fields of a list are separated by spaces, literal spaces in list fields are
denoted by <token>\s</token>.</para>

<para>The command is terminated by a newline (<token>\n</token>).</para>

<para>The same applies to replies. The reply on success is
<returnvalue>ok</returnvalue>, possibly followed by the requested
information. The reply on error is an errno-style word (&eg;
<returnvalue>perm</returnvalue>, <returnvalue>noent</returnvalue>, &etc;)
followed by a longer explanation.</para>

<variablelist>
<title>Global commands:</title>

<varlistentry>
<term><command>login</command> <option>display</option>
(<parameter>now</parameter> | <parameter>schedule</parameter>) <parameter>user</parameter> <parameter>password</parameter>
[session_arguments]</term>
<listitem>
<para>login user at specified display. if <parameter>now</parameter> is
specified, a possibly running session is killed, otherwise the login is done
after the session exits. session_arguments are printf-like escaped contents
for .dmrc. Unlisted keys will default to previously saved values.</para>
</listitem>
</varlistentry>

<varlistentry>
<term><command>resume</command></term>
<listitem>
<para>Force return from console mode, even if TTY logins are still
active.</para>
</listitem>
</varlistentry>

<varlistentry>
<term><command>manage</command> <parameter>display</parameter>
[<parameter>display_class</parameter>
[<parameter>auth_name</parameter> <parameter>auth_data</parameter>]]</term>
<listitem>
<para>Start managing the named foreign display.</para>
<para><parameter>display_class</parameter>, if specified and non-empty,
will be used for configuration matching; see <xref linkend="kdm-files"/>.
</para>
<para><parameter>auth_name</parameter> and <parameter>auth_data</parameter>
need to be passed if the display requires X authorization. The format is
the same as the 2nd and 3rd column of the <command>xauth list</command>
output.</para>
</listitem>
</varlistentry>

<varlistentry>
<term><command>unmanage</command> <parameter>display</parameter></term>
<listitem>
<para>Stop managing the named foreign display.</para>
</listitem>
</varlistentry>

</variablelist>

<variablelist>
<title>Per-display commands:</title>
<varlistentry>
<term><command>lock</command></term>
<listitem>
<para>The display is marked as locked. If the &X-Server; crashes in this
state, no auto-relogin will be performed even if the option is on.</para>
</listitem>
</varlistentry>
<varlistentry>
<term><command>unlock</command></term>
<listitem>
<para>Reverse the effect of <command>lock</command>, and re-enable
auto-relogin.</para>
</listitem>
</varlistentry>
<varlistentry>
<term><command>suicide</command></term>
<listitem>
<para>The currently running session is forcibly terminated. No auto-relogin
is attempted, but a scheduled "login" command will be executed.</para>
</listitem>
</varlistentry>
</variablelist>

<variablelist>
<title>Commands for all sockets</title>

<varlistentry>
<term><command>caps</command></term>
<listitem>
<para>Returns a list of this socket's capabilities:</para>

<variablelist>
<varlistentry>
<term><returnvalue>kdm</returnvalue></term>
<listitem>
<para>identifies &kdm;, in case some other DM implements this protocol,
too</para>
</listitem>
</varlistentry>
<varlistentry>
<term><returnvalue>list</returnvalue>, <returnvalue>lock</returnvalue>,
<returnvalue>suicide</returnvalue>, <returnvalue>login</returnvalue>,
<returnvalue>resume</returnvalue>, <returnvalue>manage</returnvalue>
</term>
<listitem>
<para>The respective command is supported</para>
</listitem>
</varlistentry>
<varlistentry>
<term><returnvalue>bootoptions</returnvalue></term>
<listitem>
<para>The <command>listbootoptions</command> command and the
<option>=</option> to <command>shutdown</command> are supported</para>
</listitem>
</varlistentry>
<varlistentry>
<term><returnvalue>shutdown &lt;list&gt;</returnvalue></term>
<listitem>
<para><command>shutdown</command> is supported and allowed for the listed
users (a comma separated list.)  <returnvalue>*</returnvalue> means all
authenticated users.</para>
</listitem>
</varlistentry>
<varlistentry>
<term><returnvalue>nuke &lt;list&gt;</returnvalue></term>
<listitem>
<para>Forced shutdown may be performed by the listed users.</para>
</listitem>
</varlistentry>
<varlistentry>
<term><returnvalue>nuke</returnvalue></term>
<listitem>
<para>Forced shutdown may be performed by everybody</para>
</listitem>
</varlistentry>
<varlistentry>
<term><returnvalue>reserve &lt;number&gt;</returnvalue></term>
<listitem>
<para>Reserve displays are configured, and <returnvalue>number</returnvalue>
are available at this time</para>
</listitem>
</varlistentry>
</variablelist>

</listitem>
</varlistentry>

<varlistentry>
<term><command>list</command> [<parameter>all</parameter> |
<parameter>alllocal</parameter>]</term>
<listitem>
<para>Return a list of running sessions.  By default all active sessions are
listed (this is useful for a shutdown warning).  If <parameter>all</parameter>
is specified, passive sessions are listed as well.
If <parameter>alllocal</parameter> is specified, passive
sessions are listed as well, but all incoming remote sessions are
skipped (this is useful for a fast user switching agent).</para>
<para>Each session entry is a comma separated tuple of:</para>
<itemizedlist>
<listitem><para>Display or TTY name</para></listitem>
<listitem><para>VT name for local sessions, remote host name prefixed by
<literal>@</literal> for remote TTY sessions, otherwise empty</para></listitem>
<listitem><para>Logged in user's name, empty for passive sessions and
outgoing remote sessions (local chooser mode)</para></listitem>
<listitem><para>Session type for active local sessions, remote hostname for
outgoing remote sessions, empty for passive sessions.</para></listitem>
<listitem><para>A Flag field:</para>
<itemizedlist><listitem><para><literal>*</literal> for the display belonging
to the requesting socket.</para></listitem>
<listitem><para><literal>!</literal> for sessions that cannot be killed by the
requesting socket.</para></listitem>
<listitem><para><literal>t</literal> for TTY sessions.</para></listitem>
</itemizedlist>
</listitem>
</itemizedlist>
<para>New fields may be added in the future.</para>
</listitem>
</varlistentry>

<varlistentry>
<term><command>reserve</command></term>
<listitem>
<para>Start a reserve login screen. If nobody logs in within some
time, the display is removed again. When the session on the display
exits, the display is removed, too.</para>
<para>Permitted only on sockets of local displays and the global
socket.</para> 
</listitem>
</varlistentry>

<varlistentry>
<term><command>activate</command>
(<parameter>vt</parameter>|<parameter>display</parameter>)</term>
<listitem>
<para>Switch to a particular VT (virtual terminal). The VT may be specified
either directly (&eg; <parameter>vt3</parameter>) or by a display using it
(eg; <parameter>:2</parameter>).</para>
<para>Permitted only on sockets of local displays and the global
socket.</para>
</listitem>
</varlistentry>

<varlistentry>
<term><command>listbootoptions</command></term>
<listitem>
<para>List available boot options.</para>
<para>The return value contains these tokens:</para>
<itemizedlist>
<listitem>
<para>A list of boot options (as shown in &kdm; itself).</para>
</listitem>
<listitem>
<para>The default boot option.</para>
</listitem>
<listitem>
<para>The current boot option.</para>
</listitem>
</itemizedlist>
<para>The default and current option are zero-based indices into the list
of boot options. If either one is unset or not determinable, it is -1.</para>
</listitem>
</varlistentry>

<varlistentry>
<term><command>shutdown</command> (<parameter>reboot</parameter> |
<parameter>halt</parameter>)
[<parameter>=<replaceable>bootchoice</replaceable></parameter>]
(<parameter>ask</parameter>|<parameter>trynow</parameter>|<parameter>forcenow</parameter>|<parameter>schedule</parameter>|<parameter>start
(<parameter>-1</parameter>|<parameter>end
(<parameter>force</parameter>|<parameter>forcemy</parameter>|<parameter>cancel)</parameter>)</parameter>)</parameter>)</term>
<listitem>
<para>Request a system shutdown, either a reboot or a halt/poweroff.</para>
<para>An OS choice for the next boot may be specified from the list returned
by <command>listbootoptions</command></para>
<para>Shutdowns requested from per-display sockets are executed when the
current session on that display exits.  Such a request may pop up a dialog
asking for confirmation and/or authentication</para>
<para><parameter>start</parameter> is the time for which the shutdown is
scheduled.  If it starts with a plus-sign, the current time is added.  Zero
means immediately.</para>
<para><parameter>end</parameter> is the latest time at which the shutdown
should be performed if active sessions are still running.  If it starts with
a plus-sign, the start time is added.  -1 means wait infinitely.  If end is
through and active sessions are still running, &kdm; can do one of the
following:</para>
<itemizedlist>
<listitem><para><parameter>cancel</parameter> - give up the
shutdown</para></listitem>
<listitem><para><parameter>force</parameter> - shut down
nonetheless</para></listitem>
<listitem><para><parameter>forcemy</parameter> - shut down nonetheless if
all active sessions belong to the requesting user.
Only for per-display sockets.</para></listitem>
</itemizedlist>
<para><parameter>start</parameter> and <parameter>end</parameter> are
specified in seconds since the &UNIX; epoch.</para>
<para><parameter>trynow</parameter> is a synonym for <parameter>0 0
cancel</parameter>, <parameter>forcenow</parameter> for <parameter>0 0
force</parameter> and <parameter>schedule</parameter> for <parameter>0
-1</parameter>.</para>
<para><parameter>ask</parameter> attempts an immediate shutdown and
interacts with the user if active sessions are still running.  Only for
per-display sockets.</para>
</listitem>
</varlistentry>

<varlistentry>
<term><command>shutdown cancel</command>
[<parameter>local</parameter>|<parameter>global</parameter>}</term>
<listitem>
<para>Cancel a scheduled shutdown. The global socket always cancels the
currently pending shutdown, while per-display sockets default to cancelling
their queued request.</para>
</listitem>
</varlistentry>

<varlistentry>
<term><command>shutdown status</command></term>
<listitem>
<para>Return a list with information about shutdowns.</para>
<para>The entries are a comma-separated tuples of:</para>
<itemizedlist>
<listitem>
<para>(<returnvalue>global</returnvalue>|<returnvalue>local</returnvalue>) -
pending vs. queued shutdown. A local entry can be returned only by a
per-display socket.</para>
</listitem>
<listitem><para>(<returnvalue>halt</returnvalue>|<returnvalue>reboot</returnvalue>)</para></listitem>
<listitem><para>start</para></listitem>
<listitem><para>end</para></listitem>
<listitem><para>("ask"|"force"|"forcemy"|"cancel")</para></listitem>
<listitem><para>Numeric user ID of the requesting user, -1 for the global
socket.</para></listitem>
<listitem><para>The next boot OS choice or "-" for none.</para></listitem>
</itemizedlist>
<para>New fields might be added later</para>
</listitem>
</varlistentry>

</variablelist>

<para>There are two ways of using the sockets:</para>
<itemizedlist>
<listitem>
<para>Connecting them directly. FifoDir is exported as
$<envar>DM_CONTROL</envar>; the name of per-display sockets can be derived
from $<envar>DISPLAY</envar>.</para>
</listitem>
<listitem>
<para>By using the <command>kdmctl</command> command (&eg; from within a
shell script). Try <command>kdmctl</command> <option>-h</option> to find out
more.</para>
</listitem>
</itemizedlist>

<para>Here is an example bash script <quote>reboot into FreeBSD</quote>:</para>

<programlisting>if kdmctl | grep -q shutdown; then
  IFS=$'\t'
  set -- `kdmctl listbootoptions`
  if [ "$1" = ok ]; then
    fbsd=$(echo "$2" | tr ' ' '\n' | sed -ne 's,\\s, ,g;/freebsd/I{p;q}')
    if [ -n "$fbsd" ]; then
      kdmctl shutdown reboot "=$fbsd" ask &gt; /dev/null
    else
      echo "FreeBSD boot unavailable."
    fi
  else
    echo "Boot options unavailable."
  fi
else
  echo "Cannot reboot system."
fi</programlisting>

</sect1>
</chapter>

<chapter id="Other-Information">
<title>Other sources of information</title>

<para>Since &kdm; is descended from &xdm;, the <ulink
url="man:xdm">xdm man page</ulink> may provide useful background
information. For X-related problems try the man pages <ulink
url="man:X">X</ulink> and <ulink url="man:startx">startx</ulink>. If you have
questions about &kdm; that are not answered by this handbook, take advantage of
the fact the &kdm; is provided under the terms of the &GNU;
General Public License: look at the source code.
</para>

</chapter>


<chapter id="credits"><title>Credits and License</title>

<para>&kdm; is derived from, and includes code from,
&xdm; &copy; Keith Packard, MIT X Consortium.</para>

<para>&kdm; 0.1 was written by &Matthias.Ettrich;.  Later versions till &kde;
2.0.x were written by &Steffen.Hansen;.  Some new features for &kde; 2.1.x and
a major rewrite for &kde; 2.2.x made by &Oswald.Buddenhagen;.</para>

<para>Other parts of the &kdm; code are copyright by the authors, and
licensed under the terms of the <ulink url="common/gpl-license.html">&GNU;
GPL</ulink>. Anyone is allowed to change &kdm; and redistribute the result
as long as the names of the authors are mentioned.</para>

<para>&kdm; requires the &Qt; library, which is copyright Troll Tech AS.</para>

<para>Documentation contributors:
<itemizedlist>

<listitem><para>Documentation written by &Steffen.Hansen;
&Steffen.Hansen.mail;</para></listitem>

<listitem><para>Documentation extended by Gregor
Zumstein<email>zumstein@ssd.ethz.ch</email>. Last update August 9,
1998</para></listitem>

<listitem><para>Documentation revised for &kde; 2 by &Neal.Crook;
&Neal.Crook.mail;. Last update August 6,
2000</para></listitem>

<listitem><para>Documentation extended and revised for &kde; 2.2 and 4.0 by 
&Oswald.Buddenhagen; &Oswald.Buddenhagen.mail;.  Last update December 7,
2007</para></listitem>

</itemizedlist></para>

<para>Documentation copyright &Steffen.Hansen;, Gregor Zumstein, &Neal.Crook;
and &Oswald.Buddenhagen;.
This document also includes large parts of the &xdm; man page,
which is &copy; Keith Packard.
The theme format documentation is heavily based on the GDM manual,
which is &copy; Martin K. Petersen, George Lebl, &RedHat;, Inc. and
Sun Microsystems, Inc.</para>

<!-- TRANS:CREDIT_FOR_TRANSLATORS -->

&underFDL;

</chapter>

<glossary id="glossary">
<title>Glossary</title>

<glossentry id="gloss-greeter">
<glossterm>greeter</glossterm>
<glossdef><para>The greeter is the login dialog, &ie; the part of &kdm;
which the user sees.</para>
</glossdef>
</glossentry>

<glossentry>
<glossterm id="gloss-entropy">entropy</glossterm>
<glossdef><para>The entropy of a system is the measure of its
unpredictability.  This is used during the generation of random numbers.</para>
</glossdef>
</glossentry>

</glossary>
</book>
<!--
Local Variables:
mode: xml
sgml-omittag: nil
sgml-shorttag: t
End:
-->

