#!/bin/sh
#
#  DEFAULT KDE STARTUP SCRIPT ( KDE-2.0 )
#

# Prevent an ever growing .ICEauthority file, since that will kill application
# startup performance.
rm -f $HOME/.ICEauthority

# Boot sequence:
#
# kdeinit is used to fork off processes which improves memory usage 
# and startup time. 
#
# * kdeinit starts the dcopserver and klauncher first. 
# * then kdesktop is launched, it is started very early in the startup
#   process to give the user visual feedback as soon as possible.
#   Since it needs a working ksycoca database it waits for a 
#   "sycoca database changed" signal from kded before it becomes functional.
# * Then kded is started. kded is responsible for keeping the sycoca
#   database up to date. When an up to date database is present it sends
#   a "sycoca database changed" signal. 
#
# * The rest of the start-up sequence is less critical.
#
# kdeinit starts dcopserver, klauncher, kdesktop, kicker, kded, kxmlrpcd and
# kwrited

# Set a left cursor instead of the standard X11 "X" cursor, since I've heard
# from some users that they're confused and don't know what to do. This is
# especially necessary on slow machines, where starting KDE takes one or two
# minutes until anything appears on the screen.
# 
# Set the background to plain grey.
# The standard X background is nasty, causing moire effects and exploding
# people's heads. We use colours from the standard KDE palette for those with
# palettised displays.

xsetroot -cursor_name left_ptr -solid '#C0C0C0'

# We set LD_BIND_NOW to increase the efficiency of kdeinit.
# kdeinit unsets this variable before loading applications.
LD_BIND_NOW=true kdeinit +kdesktop +kicker +kxmlrpcd kwrited

# initialize the configuration first.
kcminit

# activate the kde font directory
xset fp+ $KDEDIR/share/fonts
xset fp rehash

# Start remaining common desktop tools in the background.

# start kwelcome
kwelcome -kdestartup &

# scan for netscape plugins (will be removed after beta 1)
nspluginscan &

# finally, give the session control to the session manager
# Syntax:   ksmserver [-restore] [-windowmanager <wm>]
# if no windowmanager is specified, ksmserver will ensure kwin is started.
# [-restore] should be controlled by kdm
exec ksmserver -restore

