#! /bin/ksh

#
# Name	      : ${HOME}/bin/StartPuTTYXterm.ksh
#
# Version     : 1.0
#
# Author      : Gerard van Wageningen
#
# Description : PuTTY helper program to start a xterm
#
# 1.0	First Version
#


\whence set_debug 1> /dev/null 2>&1 && eval $( set_debug ${0##*/} )


print "Starting xterm..."

if [[ -z "${HOSTNAME:-}" ]]
then
 export HOSTNAME=$( uname -n )
fi

if [[ -z "${DISPLAY:-}" ]]
then
  DISPLAY=$( who am i | sed -e "s/[^(]*//;s/(//;s/)//;s/:[^\n]*//;s/\t//g;s/ //g" )':0.0'
fi

nohup /usr/bin/X11/xterm -display ${DISPLAY} -vb -fn 6x13 -sb -ls -title "${USER}@${HOSTNAME}" -geometry 132x24 0</dev/null 1>/dev/null 2>&1 &

sleep 5


exit 0


############# EOF #############
