#!/bin/sh
# /config/xdm/Xsession.blade42 installed in /tools/Xncd-5.1.140/xdm
#
# NOTICE: Do not edit the copy of this file that is installed!
# Any changes will be lost when it is overwritten by the master copy.
#
# $XConsortium: Xsession,v 1.7 92/08/06 11:08:14 gildea Exp $

# Below is historical, from sos4 setup.
#PATH=/usr/local/X11/bin:/usr/local/bin:/usr/ucb:/bin:/usr/bin:/etc:/usr/local/hosts:/usr/local/gnu/bin
# Below works okay on solaris xdm host.
PATH=/usr/openwin/bin:/usr/local/bin:/usr/ucb:/bin:/usr/bin:/etc:/usr/local/hosts:/usr/local/gnu/bin
export PATH

# Redirect errors to a file in user's home directory if we can.
for errfile in $HOME/.xsession-errors /tmp/xsession-errors.$USER
do
	if ( cp /dev/null "$errfile" 2> /dev/null )
	then
		chmod 600 "$errfile"
		exec > "$errfile" 2>&1
		break
	fi
done

# Check the user's shell, and if it is not a 'good' one, use an xterm
# to display the message embedded in their goofy shell.
case "$SHELL" in
    /users/* ) 
	    # Maybe someday get a bigger font in this xterm, with resources.
	    #xrdb -load $resources
	    exec xterm -geometry 80x24+55+125
    ;;
esac

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

UMBdefaults=/tools/Xncd/xdm/Xdefaults.Common
if [ -f $UMBdefaults ]; then
    xrdb -load $UMBdefaults
fi
resources=$HOME/.Xresources
if [ -f $resources ]; then
    xrdb -load $resources
fi

HOST=`hostname|sed -e 's/\..*//'`
exec xterm -geometry 80x24+60+0 -ls -n "$HOST" -T "$HOST" &
xbiff &
/usr/openwin/bin/twm
