#!/bin/bash -login
# (c) 1999 Red Hat Software, Inc.
# Set basic PATH
export PATH=/bin:/usr/bin:/usr/X11/bin:/local/bin
# redirect errors to a file in user's home directory if we can
for errfile in "$HOME/.xsession-errors" "${TMPDIR-/tmp}/xses-$USER" "/tmp/xses-$USER"
do
if ( cp /dev/null "$errfile" 2> /dev/null )
then
chmod 600 "$errfile"
exec > "$errfile" 2>&1
break
fi
done
echo manpath=$MANPATH
xsetroot -solid '#356390'
# Open a window to display the motd mesages. We do it in the
# background so that we do not hang is servers is not running
/local/sbin/xmotd &
# clean up after xbanner
if [ -x /usr/X11R6/bin/freetemp ]; then
/usr/X11R6/bin/freetemp
fi
# Source the system .profile if there is one
# This will run the various profiles that will set PATH, PS and other
# relavent envionment variables.
if [ -x /etc/profile ] ; then
. /etc/profile
fi
echo manpath2=$MANPATH
userresources=$HOME/.Xresources
usermodmap=$HOME/.Xmodmap
sysresources=/usr/X11R6/lib/X11/xinit/.Xresources
sysmodmap=/usr/X11R6/lib/X11/xinit/.Xmodmap
# merge in defaults and keymaps
if [ -f $sysresources ]; then
xrdb -merge $sysresources
fi
if [ -f $sysmodmap ]; then
xmodmap $sysmodmap
fi
if [ -f $userresources ]; then
xrdb -merge $userresources
fi
if [ -f $usermodmap ]; then
xmodmap $usermodmap
fi
# now, we see if xdm/gdm/kdm has asked for a specific environment
case $# in
1)
case $1 in
failsafe)
exec xterm -geometry 80x24-0-0
;;
gnome)
exec gnome-session
;;
kde)
exec startkde
;;
anotherlevel)
# we assume that switchdesk is installed.
exec /usr/share/apps/switchdesk/Xclients.anotherlevel
;;
esac
esac
# otherwise, take default action
if [ -x "$HOME/.xsession" ]; then
exec "$HOME/.xsession"
elif [ -x "$HOME/.Xclients" ]; then
exec "$HOME/.Xclients"
elif [ -x /etc/X11/xinit/Xclients ]; then
exec /etc/X11/xinit/Xclients
else
exec xsm
fi