#!/bin/bash
#
# set up environment to run remotely on iceberg.rit.edu, sending 
#   X display back to local machine
#
# MWR 9/24/2003

cat > .xinitrc <<END_OF_XINITRC
#!/bin/sh
# $Xorg: xinitrc.cpp,v 1.3 2000/08/17 19:54:30 cpqbld Exp $

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

# start some nice programs

twm &
xclock -geometry 50x50-1+1 &
xterm -geometry 80x24+510-0 -rv -sb -e ssh -l phys445 iceberg.rit.edu &
xhost +iceberg.rit.edu
exec xterm -geometry 80x24+0-0 -rv -sb -e ssh -l phys445 iceberg.rit.edu
END_OF_XINITRC

xinit .xinitrc

exit 0

