Next Previous Table of Contents
To run KDE, you must do three things:
usekde
script).To make your system aware of KDE, an environment variable KDEDIR
must be set, and the directory with the KDE executables must be added
to the system path. In this RPM distribution, scripts that do this
automatically are added to the directory /etc/profile.d
,
but they only take effect when you log in after installing the
kdesupport RPM package.
So, before proceeding,
A (bash) shell script /opt/kde/bin/usekde
is
provided to individually configure
user's accounts to use the KDE desktop.
The system administrator (root
)
may configure any user to run KDE with the command
usekde <username>
where <username> is a valid username present in
/etc/passwd
.
Individual users can configure their own desktops to run KDE with
usekde
This adds a hidden .Xclients
configuration file to
the user's home directory;
in the unlikely event that any user no longer wishes to run the KDE desktop,
they need only
delete this file to deactivate KDE.
The usekde
script does the following things:
.xinitrc
or .xsession
that exist in the user's home directory are moved to
.xinitrc.kdesave
or .xsession.kdesave
..Xclients
that exists in
the user's home directory, and is different from the version that
usekde
will install, is moved to .Xclients.kdesave
..Xclients
is installed in the user's home directory.
Assuming the X Window system configuration scripts are unchanged from
the default ones installed by the Red Hat distribution, the user's
.Xclients
file will control the X Window session, whether
it is started by startx
(xinit
) or by the X Display Manager
(xdm
or kdm
).
By default, usekde
copies the (hidden) .Xclients
file
from /opt/kde/etc/skel
. This directory also
contains default KDE user configurations in subdirectories
Desktop
and .kde
. If the user's
home directory does not contain Desktop
or
.kde
directories, the script .Xclients
causes copies to be taken (by default) from /opt/kde/etc/skel
.
Note that the default Desktop
and .kde
KDE configurations are only installed when .Xclients
is run during the startup of the X Window system,
if they do not already exist in the user's home directory.
If a user's KDE configuration is old, the user may wish
to move the old Desktop
and .kde
directories
out of the way, and start the X Window system
to try out the new
configuration.
If the System Manager wishes to customize the configuration, it is
recommended to copy the contents of /opt/kde/etc/skel
to (say) /etc/skel
:
cp -a /opt/kde/etc/skel/.kde /etc/skel
cp -a /opt/kde/etc/skel/.kderc /etc/skel
cp -a /opt/kde/etc/skel/Desktop /etc/skel
cp -a /opt/kde/etc/skel/.Xclients /etc/skel
Then edit the copies to make any customizations needed in .Xclients
,
(or to files in .kde/share/config
, which control
the state of the desktop when it first starts.)
If you make your customizations to the original files in
/opt/kde/etc/skel
, you risk losing then next time
you reinstall or upgrade the kdebase
RPM package.
The customized
configuration in /etc/skel
becomes
the default configuration when the
environment variable $KDE_SKELDIR
points to their location. To do this,
add the lines
KDE_SKELDIR="/etc/skel"
export $KDE_SKELDIR
to your /etc/profile
file.
(You can of course use a location different from
/etc/skel
). The Desktop
and .kde
directories
will first be looked for in $KDE_SKELDIR
, if it is
defined, then in $KDEDIR/etc/skel
.
You may wish to provide every new user with a KDE configuration,
but leave it up to the user to activate it by running "usekde
".
In this case, do not put the .Xclients
in /etc/skel
.
Set the environment variable $KDE_XCLIENTS
to point to your
customized default .Xclients
that usekde
installs,
by also adding, e.g.,
KDE_XCLIENTS="/opt/kde/etc/skel/.Xclients"
export $KDE_XCLIENTS
to /etc/profile
.
The usekde
script looks for the default
.Xclients
to install in this order:
(1) $KDE_XCLIENTS
;
(2) $KDE_SKELDIR/.Xclients
;
(3) $KDEDIR/etc/skel/.Xclients
.
If it is not found, usekde
terminates with
an error message.
Using /etc/skel
has the advantage that any new user
accounts that you set up will automatically be configured to
use the KDE desktop. Use a different location for the default
.Xclients
, if you do not
want this to be the case.
The default .Xclients
file installed by this distribution
runs scripts
/opt/kde/bin/kdesetup
(whch installs the
.kde
and Desktop
directories, if they
are missing) and
/opt/kde/bin/startkde
.
If any customizations are needed for your system,
you may wish to copy the startkde
script to the .Xclients
file, and customize it there.
For example, if you find that your /tmp
directory
gets littered with leftover KDE temporary files from your old
KDE sessions, you may wish to add a line that deletes them.
KDE applications have session support, and unless this feature
is disabled, KDE applications will restart in a new KDE session
in the same state that they had when the previous session was shut
down. The system administrator can use this feature to create the desired
default
KDE configuration that a new KDE user will see when they first run
KDE, and copy the
contents of the resulting
Desktop
and .kde/share/config
directories to the equivalent subdirectories of
the directory $KDE_SKELDIR
.
You can also simply make KDE the default for all users,
without running the usekde
script, by replacing
the default Red Hat file /etc/X11/xinit/Xclients
with a
copy of .Xclients
. However, this will only work
for users who do not have .xinitrc
or
.xsession
files in their home directory.
(Running the script "usekde
" guarantees that
this is not the case.)
The usekde
script described in the previous section
will have configured the KDE desktop to start whenever the
user opens an X Windows session. This section will give a brief
overview on how X Window sessions are opened on Red Hat systems.
Note that a common error by first-time KDE users is to attempt to run
the "startkde
" script themselves, without starting the
X Window system. The "startkde
" script is designed
to called by the X Window startup script (in this case,
~/.Xclients
),
and not to be directly run by the user.
The two distinct methods of starting an X Window session on Red Hat Linux are
startx
The X Window session then starts. It can usually be
terminated by the
combined three-finger keystroke control-alt-backspace
(unless this has been disabled).
xdm
, or its KDE replacement
kdm
, described later) is running. The user then just logs
in using the X Display Manager login window, and KDE starts.
When the user logs out,
the X Window session terminates, and
the X Display Manager login window reappears.In the second case, the X Display Manager may have started
automatically when the system was booted.
This occurs if the system is configured
to boot into "runlevel 5
" in the /etc/inittab
configuration
file. You can
configure this using the Red Hat system administration tools
(runlevel editor) that come
with the Red Hat distribution, or (carefully!) edit /etc/inittab
to
change the line
"id:3:initdefault:
" to "id:5:initdefault:
".
If the system is not configured this way, root
can start the
X Display Manager by typing
telinit 5
and shut it down again with
telinit 3
Another way for root
to start the X Display Manager
is to type "xdm
" or "kdm
". In this
case it can only be shut down by root
with "kill -INT <pid>
",
where <pid> is the Process ID number of the xdm or kdm which is running.
This is written in /var/run/xdm.pid
(for both
xdm and kdm), so "cat /var/run/xdm.pid
" will tell you what it is.
Here is a summary of how how the various X Windows configuration files are used on a default Red Hat 4.2, 5.0, 5.1 or 5.2 installation, for both methods of starting X:
startx
").
A user is logged in at a console, and types "startx
".
This is a script that
invokes "/usr/X11R6/bin/xinit
" to start X.
When xinit
runs, it first looks in the user's home directory
for a script .xinitrc
, and runs it if it is present.
If no such script exists, it runs the system
default script /etc/X11/xinit/xinitrc
.
In turn, /etc/X11/xinit/xinitrc
looks for .Xclients
in the user's home directory, and runs it
if it is present.
If no such script exists,
it runs the script /etc/X11/xinit/Xclients
which starts the
default Red Hat window manager.
So, if there is no .xinitrc
in the user's home directory, a
.Xclients
script in the user's home
directory will control how X starts.
xdm
" or
"kdm
").
When xdm
or kdm
starts,
it runs a script /etc/X11/xdm/Xsession
. This Xsession script
accepts a single argument, the "session type". In the Red Hat script,
if the session type is "failsafe
", a very simple xterm window opens
(presumably allowing corrupted startup scripts to be repaired). If the
session type is not "failsafe
",
the Xsession script looks for a script .xsession
in the user's home directory, and runs it if it is present.
If no such script exists, Xsession
looks for .Xclients
in the user's home directory,
and runs it if it is present.
If no such script exists,
it runs the script /etc/X11/xinit/Xclients
which starts the
default Red Hat window manager.
So, if there is no .xsession
in the user's home directory, a
.Xclients
script in the user's home directory
will control how X starts.
Next Previous Table of Contents