#!/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
#

#
# if fontpath is null, extend it.
#
#if [ "`xset q | grep fonts`" = "" ]; then
#	xset fp default
#	xset fp+ /XP/fonts/openlook,/XP/fonts/tek100dpi,/XP/fonts/dw100dpi
#	xset fp+ /usr/local/X11/lib/fonts/100dpi,/usr/local/X11/lib/fonts/75dpi
#	xset fp+ /usr/local/X11/lib/fonts/misc
#	xset fp+ /usr/local/X11/lib/fonts/xview/misc
#fi
case $# in
1)
	case $1 in
	failsafe)
		exec xterm -geometry 80x24-0-0 -ls
		;;
	esac
esac

#xhost localhost
#xhost `hostname`

cd ${HOME}
append=`expr $DISPLAY : '\([^.|^:]*\)'`
session=$HOME/.Xsession
resources=$HOME/.Xdefaults

if [ -x $session-$append ]; then
	exec $session-$append
fi
if [ -x $session-`hostname` ]; then
	exec $session-`hostname`
fi
if [ -x $session ]; then
	exec $session
fi
if [ -x $HOME/.xsession ]; then
	exec $HOME/.xsession
fi
if [ -f $resources ]; then
	xrdb -DHNAME=$append -load $resources
else
	xrdb -load /usr/local/X11/lib/app-defaults/Xdefaults
fi

#xhost gene > /dev/null &
xterm -title "$cpu /dev/console" -name console -geometry 64x4+0+0 \
	\#-374+2 -name xterm-console -fn 6x10 \
		-sb -sl 1000 -display $DISPLAY -C						&
xterm -geometry 80x55+8+154 -display $DISPLAY					&
xterm -geometry 80x55+580+154 -display $DISPLAY					&
xclock  -geometry 64x64+408+0									&
xload   -geometry 64x64+1017+0 -display $DISPLAY				&
twm
