lib/scripts/isa-xterm
author wenzelm
Fri, 07 Mar 1997 09:43:05 +0100
changeset 2743 b001ec2b56e1
parent 2713 7231c1e89706
child 2770 5a3224f488db
permissions -rwxr-xr-x
tuned;

#!/bin/bash -norc
#
# $Id$
#
# Isabelle within an xterm.


## diagnostics

PRG=$(basename $0)

function usage()
{
  echo
  echo "Usage: $PRG [OPTIONS] [--] [CMDLINE]"
  echo
  echo "  Options are:"
  echo "    -g GEOM      main window geometry (default 80x60)"
  echo "    -p TEXT      pass text (options etc.) to isabelle session"
  echo "    -s BOOL      symbolic font output? (default true)"
  echo
  echo "  Starts Isabelle within an xterm window. CMDLINE is passed"
  echo "  directly to the isabelle session."
  echo
  exit 1
}

function fail()
{
  echo "$1" >&2
  exit 2
}


## process command line

# options

MAINGEOM="80x60"
PASS=""
SYMBOLS="true"

while getopts "g:p:s:" OPT
do
  case "$OPT" in
    g)
      MAINGEOM="$OPTARG"
      ;;
    p)
      PASS="$PASS $OPTARG"
      ;;
    s)
      SYMBOLS="$OPTARG"
      ;;
    \?)
      usage
      ;;
  esac
done

shift $(($OPTIND - 1))


## main

if [ -z "$SYMBOLS" -o "$SYMBOLS" = false ]; then
  exec xterm -T Isabelle -n Isabelle -geometry "$MAINGEOM" -e $ISABELLE $PASS "$@"
else
  $ISATOOL installfonts
  exec xterm -T Isabelle -n Isabelle -geometry "$MAINGEOM" -fn isacr14 \
    -xrm "*fontMenu.Label: Isabelle fonts" \
    -xrm "*fontMenu*font1*Label: Large" \
    -xrm "*VT100*font1: isacb24" \
    -xrm "*fontMenu*font2*Label:" \
    -xrm "*VT100*font2:" \
    -xrm "*fontMenu*font3*Label:" \
    -xrm "*VT100*font3:" \
    -xrm "*fontMenu*font4*Label:" \
    -xrm "*VT100*font4:" \
    -xrm "*fontMenu*font5*Label:" \
    -xrm "*VT100*font5:" \
    -xrm "*fontMenu*font6*Label:" \
    -xrm "*VT100*font6:" \
    -e $ISABELLE -m symbols $PASS "$@"
fi