Files
heimdal/appl/kx/rxterm.in
Assar Westerlund 29f2df0170 new argument '-w term_emulator' for specifiying which terminal
emulator to use.  Based on a patch from <arve@nada.kth.se>.


git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@1836 ec53bebd-3082-4978-b11e-865c3cabbd6b
1997-06-03 00:55:46 +00:00

38 lines
945 B
Bash

#!/bin/sh
# $Id$
#
usage="Usage: $0 [-l username] [-k] [-r rsh_args] [-x xterm_args] [-w term_emulator] host"
term=xterm
while true
do
case $1 in
-l) rsh_args="${rsh_args} -l $2 "; kx_args="${kx_args} -l $2"; title="${2}@"; shift 2;;
-r) rsh_args="${rsh_args} $2 "; shift 2;;
-x) xterm_args="${xterm_args} $2 "; shift 2;;
-k) kx_args="${kx_args} -k"; shift;;
-w) term=$2; shift 2;;
-*) echo "$0: Bad option $1"; echo $usage; exit 1;;
*) break;;
esac
done
if test $# -lt 1; then
echo "Usage: $0 host [arguments to $term]"
exit 1
fi
host=$1
title="${title}${host}"
bindir=%bindir%
pdc_trams=`dirname $0`
PATH=$pdc_trams:$bindir:$PATH
export PATH
set -- `kx $kx_args $host`
if test $# -ne 3; then
exit 1
fi
screen=`echo $DISPLAY | sed -ne 's/[^:]*:[0-9]*\(\.[0-9]*\)/\1/p'`
pid=$1
disp=${2}${screen}
auth=$3
kill -USR1 $pid
rsh -n $rsh_args $host "env DISPLAY=$disp XAUTHORITY=$auth $term -T $title -n $title $xterm_args &"