lib/scripts/isa-xterm
author wenzelm
Tue Apr 22 11:37:12 1997 +0200 (1997-04-22)
changeset 3007 e5efa177ee0c
parent 2788 0178e3cd9714
child 5965 f91212fd2c7c
permissions -rwxr-xr-x
removed -norc;
     1 #!/bin/bash
     2 #
     3 # $Id$
     4 #
     5 # Simple Isabelle interface based on xterm.
     6 
     7 
     8 ## diagnostics
     9 
    10 PRG=$(basename $0)
    11 
    12 function usage()
    13 {
    14   echo
    15   echo "Usage: $PRG [OPTIONS] [--] [CMDLINE]"
    16   echo
    17   echo "  Options are:"
    18   echo "    -g GEOM      main window geometry (default 80x60)"
    19   echo "    -h MODE      highlight mode, may be false, bold (default), color"
    20   echo "    -p TEXT      pass text (options etc.) to isabelle session"
    21   echo "    -s BOOL      symbolic font output? (default true)"
    22   echo
    23   echo "  Starts Isabelle within an xterm window. CMDLINE is passed"
    24   echo "  directly to the isabelle session."
    25   echo
    26   exit 1
    27 }
    28 
    29 function fail()
    30 {
    31   echo "$1" >&2
    32   exit 2
    33 }
    34 
    35 
    36 ## process command line
    37 
    38 # options
    39 
    40 MAINGEOM="80x60"
    41 HILITE=bold
    42 PASS=""
    43 SYMBOLS="true"
    44 
    45 while getopts "g:h:p:s:" OPT
    46 do
    47   case "$OPT" in
    48     g)
    49       MAINGEOM="$OPTARG"
    50       ;;
    51     h)
    52       HILITE="$OPTARG"
    53       ;;
    54     p)
    55       PASS="$PASS $OPTARG"
    56       ;;
    57     s)
    58       SYMBOLS="$OPTARG"
    59       ;;
    60     \?)
    61       usage
    62       ;;
    63   esac
    64 done
    65 
    66 shift $(($OPTIND - 1))
    67 
    68 
    69 ## main
    70 
    71 if [ "$HILITE" = bold ]; then
    72   PASS="-m xterm $PASS"
    73 elif [ "$HILITE" = color ]; then
    74   PASS="-m xterm_color $PASS"
    75 elif [ -n "$HILITE" -a "$HILITE" != false ]; then
    76   echo "WARNING: unknown highlight mode '$HILITE'" >&2
    77 fi
    78 
    79 if [ -z "$SYMBOLS" -o "$SYMBOLS" = false ]; then
    80   exec xterm -T Isabelle -n Isabelle -geometry "$MAINGEOM" -e $ISABELLE $PASS "$@"
    81 else
    82   $ISATOOL installfonts
    83   exec xterm -T Isabelle -n Isabelle -geometry "$MAINGEOM" -fn isabelle14 \
    84     -xrm "*fontMenu.Label: Isabelle fonts" \
    85     -xrm "*fontMenu*font1*Label: Large" \
    86     -xrm "*VT100*font1: isabelle24" \
    87     -xrm "*fontMenu*font2*Label:" \
    88     -xrm "*VT100*font2:" \
    89     -xrm "*fontMenu*font3*Label:" \
    90     -xrm "*VT100*font3:" \
    91     -xrm "*fontMenu*font4*Label:" \
    92     -xrm "*VT100*font4:" \
    93     -xrm "*fontMenu*font5*Label:" \
    94     -xrm "*VT100*font5:" \
    95     -xrm "*fontMenu*font6*Label:" \
    96     -xrm "*VT100*font6:" \
    97     -e $ISABELLE -m symbols $PASS "$@"
    98 fi