#!/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, 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 color to plain gray to avoid eye
# irritations for some people (including me :)

xsetroot -cursor_name left_ptr -solid dimgray


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

# initialize the configuration first.
kcminit

# Start remaining common desktop tools in the background.

# kwmsound is not working with aRts & kwin (should probably use knotify anyway)
#kwmsound

#kicker is smart and forks as well
kicker

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

# 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

