#! /bin/sh
#
# Xsession
#
# This is the program that is run as the client
# for the display manager.  This example is
# quite friendly as it attempts to run a per-user
# .xsession file instead of forcing a particular
# session layout
#

echo $PATH | grep /usr/X11/R5/bin >/dev/null 2>&1
if test $? -ne 0; then
    PATH=/usr/X11/R5/bin:${PATH}
    export PATH
fi

MANPATH=/usr/man:/usr/X11/R5/man:/usr/local/man
export MANPATH

USER=`whoami`
export USER

case $# in
    1)
	case $1 in
	    failsafe)
		exec xterm -geometry 80x24-0-0 -ls
		;;
	esac
esac

startup=$HOME/.Xsession
resources=$HOME/.Xresources

if [ ! -f $startup ]; then
    startup=$HOME/.xsession
fi

if [ -f $startup ]; then
    test -x $startup && exec $startup
    exec /bin/sh $startup
else
    if [ ! -f $resources ]; then
	resources=$HOME/.Xdefaults
    fi
    if [ -f $resources ]; then
	xrdb -load $resources
    fi
    xterm -T `hostname` -geometry 80x64+300+10 -ls -fn 7x13 &
    xclock -geometry 105x105-1+1 &
    xbiff  -geometry 80x50+1+1 &
    exec twm    
fi
