#!/bin/sh
#
# /etc/X11/xdm/Xsetup
#
# This script is run whenever xdm is asked to manage a display.

PATH=$PATH:/usr/bin/X11
HOSTSERVER=$(echo $DISPLAY | cut -d. -f1)
PIDFILE=/var/run/xconsole.$HOSTSERVER.pid
CONSOLEDEV=/dev/xconsole

if [ -e $PIDFILE ]; then
  PID=$(cat $PIDFILE 2> /dev/null)
  if [ -n "$PID" ]; then
    kill $PID 2> /dev/null
  fi
  rm $PIDFILE
fi

if [ -r $CONSOLEDEV ]; then
  xconsole -geometry 480x130-0-0 -notify -verbose -fn fixed -exitOnFail -file $CONSOLEDEV &
  echo $! > $PIDFILE
fi

exit 0

# vim:set ai et sts=2 sw=2 tw=0:
