#**********************************************************************#
#*                                                                    *#
#* Copyright (c) 2001 by Sun Microsystems, Inc.                       *#
#* All rights reserved.                                               *#
#*                                                                    *#
#**********************************************************************#

# usage: ncd97unikix [-4 | -5] shlscrpt-name [screen-position]
: $Workfile:   ncd97unikix.sh  $ $Revision:   1.0  $
# usage: ncd97unikix shlscrpt-name screen-position 
# used to open an xterm window on the ncd97

# params:  4    Model 4 window (43x80)
#          5    Model 5 window (27x132)
#          SHLSCRPT to execute on xterm
#          SCRNPOS of xterm


PARAM1=$1
PARAM2=$2
PARAM3=$3
GMTRY=80x25
set -- `getopt 45 $*`

#while options to process
while test  "$1" != "--"
do
    case $1 in
    -4)
        GMTRY=80x43
        ;;
    -5)
        GMTRY=132x27
        ;;
    esac
    shift
done

if test "$GMTRY" != "80x25"
then
    SHLSCRPT=$PARAM2
    SCRNPOS=$PARAM3
else
    SHLSCRPT=$PARAM1
    SCRNPOS=$PARAM2
fi

xterm +sb -geom $GMTRY$SCRNPOS  -title "3270 Session" -tn xterms \
    -xrm 'XTerm*vt100*translations:	#override \
	<Key> KP_Subtract: 	string("Om") \n\
	<Key> KP_Separator: 	string("Ol") \n\
	<Key> KP_Enter: 	string("OM") \n\
   	<Key> KP_0:         	string(0x1b) string("[1~")\n\
   	<Key> KP_7:           	string(0x1b) string("[2~")\n\
   	<Key> KP_9:          	string(0x1b) string("[3~")\n\
   	<Key> KP_Decimal:      	string(0x1b) string("[4~")\n\
   	<Key> KP_1:          	string(0x1b) string("[5~")\n\
   	<Key> KP_3:           	string(0x1b) string("[6~")\n\
   	<Key> KP_8:           	string(0x1b) string("[A")\n\
   	<Key> KP_2:           	string(0x1b) string("[B")\n\
   	<Key> KP_6:           	string(0x1b) string("[C")\n\
   	<Key> KP_4:           	string(0x1b) string("[D")\n\
   	<Key> Delete:          	string(0x1b) string("[4~")\n\
   	Shift<Key> Tab:       	string(0x1b) string(0x09) ' \
        -e $SHLSCRPT -k ncd97.key &
exit $?
