#!/bin/sh

PATH=$PATH:/usr/local/bin ; export PATH

exec > $HOME/.xsession-errors 2>&1

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

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

if [ ! -f $HOME/.motd ]; then
	string=doit
else
	string=`find /etc/motd -newer $HOME/.motd -print`
fi

if [ -n "$string" ]; then
   xmessage -name "Message of the Day" -file /etc/motd -g +0-0 &
fi

touch $HOME/.motd

xmodmap -e "keysym BackSpace = Delete"

export DISPLAY

xrdb -load /usr/lib/X11/xdm/Xresources

if [ -f $startup ]; then
	exec $startup
else
	if [ -f $resources ]; then
		xrdb -load $resources
	fi

	xterm -fn 10x20 -geometry 80x24+0+0 -T `hostname` -n `hostname` -sb -sl 500 -ls &
	xeyes -geometry 62x32-1+-2     &
	exec twm
fi

