#!/bin/sh
# @(#)Xsession 1.4 91/09/14
#
# 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
#
OPENWINHOME=${OPENWINHOME:-/usr/openwin}
LD_LIBRARY_PATH=$OPENWINHOME/lib
PATH=$OPENWINHOME/bin:$PATH
MANPATH=$OPENWINHOME/man:$MANPATH
export LD_LIBRARY_PATH PATH MANPATH

# try source .login/.profile
#
#case $SHELL  in
#"/bin/csh")
#	. $HOME/.login
#	. $HOME/.cshrc
#	;;
#"/bin/ksh")
#	. $HOME/.profile
#	;;
#esac


#
# Force server to change userid to $USER
#
$OPENWINHOME/bin/xhost +$USER@ > /dev/null 2>&1


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

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

if [ -f $startup ]; then
	exec /bin/sh $startup
else
	if [ -f $resources ]; then
		xrdb -load $resources
	fi
	twm &
	exec xterm -geometry 80x24+10+10 -ls
fi
