# Startup script for the GNU bash shell. This is more or less Korn shell
# compatible and you may need to grab some of the things from here if
# you normally use the Bourne shell.
alias h=history
alias gs="gs -I/homes2/fox/crunch/usr/fox/gnu/ghost/fonts"
alias ls="ls -spaCF"
alias CM="/localhome/fox/bin/cm"
CDPATH=.:/localhome/fox:/home/fox
OWIN=/usr/local/openwin/bin:/usr/local/openwin/bin/xview:/usr/local/openwin/demo
CRTHOME=/localhome/fox/vt220
BKBD=xterm
export CRTHOME BKBD

xterm ()
{
	$OPENWINHOME/demo/xterm -name xcrisp $*
}
sunview ()
{
	BTERM=sun-crttool
	/usr/bin/sunview -f 255 255 0 -pattern grey
}
ow ()
{
	OPATH=$PATH
	PATH=${OWIN}:$PATH
	export PATH
	BTERM=xcrisp
	~/bin/openwin
	PATH=$OPATH
}
openwin ()
{
	OPATH=$PATH
	PATH=${OWIN}:$PATH
	export PATH
	BTERM=xterm-openwin-sf
	/usr/local/openwin/bin/openwin
	PATH=$OPATH
}
cd ()
{
	builtin cd $*
	label "$HOSTNAME -- $TTY -- $PWD -- PID: $$"
	if [ "$TERM" = "xterm" ]; then
		PS1="${PWD}: "
	else
		PS1="[33m[1m${PWD}: [0m[32m"
	fi
}

close ()
{
	echo -e -n '\033[2t'
}
open ()
{
	echo -e -n '\033[1t'
}
back ()
{
	echo -e -n '\033[6t'
}
front ()
{
	echo -e -n '\033[5t'
}

crt ()
{
	CRTHOME=/localhome/fox/vt220
	BTERM=sun-crttool
	export CRTHOME BTERM
}
move ()
{
	echo -e -n '\033[3t'
}
refresh ()
{
	echo -e -n '\033[7t'
}
label ()
{
	if [ "$DISPLAY" != "" ]; then
		if [ "$TERM" != "vt200" ]; then
			echo -e -n "\033]0;$*"
		fi
	else
		echo -e -n "\033]l$*\033\134"
	fi
}
icon ()
{
	echo -e -n "\033]L$*\033\134"
}
setenv ()
{
	export $1="$2"
}
if [ "$WINDOW_PARENT" != "" ]; then
	TTY=`tty`
	cd .
fi
 
# Tell Xterm to send/not-send DEC mouse sequences.
mouse ()
{
	if [ "$1" = on ]; then
		echo -e -n "\033[?9h"
	else
		echo -e -n "\033[?9l"
	fi
	
}
