Skip to content

Instantly share code, notes, and snippets.

@hlecuanda
Created January 5, 2017 20:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hlecuanda/eda1394f288017f37426ceddb7b4b524 to your computer and use it in GitHub Desktop.
Save hlecuanda/eda1394f288017f37426ceddb7b4b524 to your computer and use it in GitHub Desktop.
XTerm reference scripts
#!/bin/sh
# vax
# 09-17-96 Bob Ess - initial creation
# 09-26-96 Shig Katada - Additional keybindings
#
# Script file to incorporate keybindings and command line
# options for connecting to a VAX node
# Usage statement
Usage(){
echo
echo " Usage : vax -options"
echo
echo " Options: -80 for 80 column terminal"
echo " -132 for 132 column terminal"
echo " -fg colorname"
echo " -bg colorname"
echo " -fn fontname"
echo " -fb bold fontname"
echo " -host [altair] [devel] [leonis] [castor]"
echo ""
echo " Example: \"vax -80 -fg white -bg black -fn 9x15 -fb 9x15b -host castor\""
echo " Starts a VAX session with an 80 column terminal"
echo " with a black background, white foreground, a normal"
echo " font of 9x15 and a bold font of 9x15b, and connects"
echo " to the node 'castor'"
echo
echo " If you need additional help, please call Workstation"
echo " Services at x92396."
echo
exit 1
}
# Default to a black foreground with a white background.
# Use the 9x15 and 9x15bold fonts. Connect to castor by default.
#
FG=black
BG=white
HOST=castor
FONT=9x15
BFONT=9x15bold
COLS=80
# Parse the command line arguments
#
while [ $# != 0 ];
do
case $1 in
-80) COLS=80
FONT=spc12x24c
BFONT=spc12x24b
shift
;;
-132) COLS=132
FONT=9x15
BFONT=9x15b
shift
;;
-fg) shift
FG=$1
shift;;
-bg) shift
BG=$1
shift;;
-fn) shift
FONT=$1
shift;;
-fb) shift
BFONT=$1
shift;;
-host) shift
HOST=$1
shift;;
-help) Usage;;
*) Usage;;
esac
done
xterm -title "VAX" -sb -sl 1200 -geo ${COLS}x24 -fg ${FG} -bg ${BG} \
-cr red -fn ${FONT} -fb ${BFONT} -xrm \
'XTerm*VT100.translations: #override \n\
<Key>Insert: string(\001) \n\
Shift <Key>Up: scroll-back(1,lines) \n\
Shift <Key>Down: scroll-forw(1,lines) \n\
Shift <Key>Right: string(0x1b) string("f") \n\
Shift <Key>Left: string(0x1b) string("b") \n\
Shift <Key>Delete: string(0x1b) string(0x08) \n\
Shift <Key>Tab: string(0x1b) string("*") \n\
<Key>0x1000FF0D: scroll-back(1,page) \n\
<Key>0x1000FF0E: scroll-forw(1,page) \n\
<Key>0x1000FF09: string(\010) \n\
<Key>0x1000FF0A: string(\005) \n\
<Key>BackSpace: string(0xff) \n\
<Key>Select: select-start() \n\
<Key>0x1000FF02: select-end(PRIMARY,CUT_BUFFER0) \n\
Meta <Key>0x1000FF02: select-end(CLIPBOARD) \n\
<Key>0x1000FF04: insert-selection(PRIMARY,CUT_BUFFER0) \n\
Meta <Key>0x1000FF04: insert-selection(CLIPBOARD) \n\
<Key>F1: string(0x1b) string("OP") \n\
<Key>F2: string(0x1b) string("OQ") \n\
<Key>F3: string(0x1b) string("OR") \n\
<Key>F4: string(0x1b) string("OS") \n\
<Key>F5: string(0x1b) string("OA") \n\
<Key>F11: string(0x1b) string("[23~") \n\
<Key>F12: string(0x1b) string("[24~") \n\
<Key>KP_0: string(0x1b) string("Op") \n\
<Key>KP_1: string(0x1b) string("Oq") \n\
<Key>KP_2: string(0x1b) string("Or") \n\
<Key>KP_3: string(0x1b) string("Os") \n\
<Key>KP_4: string(0x1b) string("Ot") \n\
<Key>KP_5: string(0x1b) string("Ou") \n\
<Key>KP_Divide: string(0x1b) string("OP") \n\
<Key>KP_Multiply: string(0x1b) string("[29~") \n\
<Key>KP_Enter: string(0x1b) string("OM") \n\
<Key>KP_Subtract: string(0x1b) string("Om") \n\
<Key>KP_Add: string(0x1b) string("Ol") \n\
<Key>KP_Decimal: string(0x1b) string("On") \n\
<Btn1Down>: select-start() \n\
<Btn1Motion>: select-extend() \n\
<Btn1Up>: select-end(PRIMARY,CUT_BUFFER0) \n\
Button1<Btn2Down>: select-end(CLIPBOARD) \n\
Button1<Btn2Up>: ignore()' \
-e telnet $HOST &
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment