#!/bin/sh
#
# /etc/X11/@kdm_package@/Xsetup_0
#
# This script is run whenever kdm is asked to manage a display on :0

sysmodmap=/etc/X11/Xmodmap

if grep -qs ^run-xconsole /etc/X11/@kdm_package@/xdm.options; then
  if [ -e /var/run/xconsole_0.pid ]; then
    # kill any running xconsole
    pid=$(cat /var/run/xconsole_0.pid 2> /dev/null)
    if [ "$pid" ]; then
      kill $pid 2> /dev/null
    fi
    rm /var/run/xconsole_0.pid
  fi
  # start fresh xconsole and store its PID
  xconsole -geometry 480x130-0-0 -notify -verbose -fn fixed \
   -exitOnFail -file /dev/xconsole &
  echo $! > /var/run/xconsole_0.pid
fi

if [ -x /usr/bin/X11/xmodmap ]; then
  if [ -f $sysmodmap ]; then
    xmodmap $sysmodmap
  fi
fi

KDE_BITMAP=/@kde_datadir@/kdesktop/pics/kde2.xbm
 
if [ -f $KDE_BITMAP ]
then
  xsetroot -cursor_name left_ptr -bitmap $KDE_BITMAP -fg '#585858' -bg '#404040'
else
  xsetroot -cursor_name left_ptr -solid '#C0C0C0'
fi
                                 
#/@kde_bindir@/kdmdesktop &
exit 0
