#!/bin/sh

# Read the X resources first, because some of them may be used for xsession.
if [ -r "$HOME"/.Xdefaults ]
then
	xrdb -load "$HOME"/.Xdefaults
fi

# If xsession is in the PATH, execute it; otherwise, start a window manager and
# an xterm.
if [ -x `which xsession` ]
then
	if [ "$DISPLAY" = ":0" -o "$DISPLAY" = ":0.0" ]
	then
		exec xsession -console
	else
		exec xsession
	fi
else
	twm &
	xterm -ls
fi
