#!/bin/sh
  
# Execute initialization code common to all session scripts.
. /etc/gdm/Sessions/Common/SessionInit


# Abort if the $WM binary can not be found.
if [ ! -n "`which $WM`" ]; then
   echo "$WM: $WM not found. Quiting." >&2
   exit 1
fi


# Source $LANG setup code common to all session scripts.
. /etc/gdm/Sessions/Common/SessionLang


# Source environment variable setup code common to all session scripts.
. /etc/gdm/Sessions/Common/SessionEnvironmentVariables



for i in /etc/profile.d/*.sh ; do
        if [ -x $i ]; then
                . $i
        fi
done



sysmodmap=/etc/X11/Xmodmap
usrmodmap=$HOME/.Xmodmap
resources=$HOME/.Xresources

startssh=
sshagent=/usr/bin/ssh-agent

if [ -x $sshagent -a -z "$SSH_AUTH_SOCK" ]; then
	startssh=yes
fi

if [ -x /usr/X11R6/bin/xmodmap ]; then
	if [ -f $sysmodmap ]; then
		xmodmap $sysmodmap
	fi
	if [ -f $usrmodmap ]; then
		xmodmap $usrmodmap
	fi
fi

if [ -r "$resources" ]; then
	xrdb -load "$resources"
fi

xhost +localhost


if [ -x /IBM/bin/desktopConfig ]; then
   /IBM/bin/desktopConfig
fi


if [ -n "$startssh" ]; then
  exec $sshagent -- $WM -f /tmp/profile/user/.twmrc
else
  exec $WM -f /tmp/profile/user/.twmrc
fi


