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

if grep -qs ^run-xconsole /etc/X11/kdm/kdm.options; 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 -f /var/run/xconsole_0.pid
  # 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

/usr/bin/kdmdesktop &
