#!/bin/ksh
export PATH="/usr/bin:${PATH}:/usr/dt/bin:/usr/local/kde/bin:/usr/openwin/bin"
export LD_LIBRARY_PATH=/usr/local/lib:/usr/sfw/lib:/usr/openwin/lib:/usr/local/qt/lib:/usr/local/kde/lib

if [ "x$LC_ALL" = x -a "x$LANG" = x -o "x$LANG" = xC ]; then
  export LC_ALL="C"
  export LC_CTYPE="C"
else
  export LC_MESSAGES=$LANG
fi

if [ "x$MANPATH" = x ]; then
  export MANPATH=/usr/share/man:/usr/man
else
  export MANPATH=$MANPATH:/usr/man
fi

/usr/openwin/bin/xrdb -merge << EOF
! Default CDE resources
*WindowColor:           #8A008A008A00
!*WindowForeground:      #FF0000000000
!*DataBackground:        #0000FF000000
*DataForeground:        #FF0000000000
*WorkspaceColor:        #8A008A008A00
*Color.Background:      #FF000000FF00
!*Color.Foreground:      #0000FF000000
*foreground:            #000000000000
! Hack for Dtmail
*XmText*background: seashell
*XmTextField*background: seashell
*Message_List*background: seashell
*background:    #AE00B200C300
Dthello*string:		Welcome to the KDE
EOF

if [ -f $HOME/.Xdefaults ]; then
    xrdb -merge $HOME/.Xdefaults        # Load Users X11 resource database
fi

echo "Starting KDE 3"

if [ "$DTXSERVERLOCATION" != "remote" ]; then
  console=False
  case "$DISPLAY" in
  *:0|*:0.0)
    console=True
    ;;
  esac
fi

exec /usr/local/kde/bin/startkde
