lib/scripts/isa-xterm
author wenzelm
Mon, 03 Mar 1997 18:25:17 +0100
changeset 2712 44a657985de1
parent 2702 4167688e58aa
child 2713 7231c1e89706
permissions -rwxr-xr-x
removed -r option; added -p option;

#!/bin/bash -x
#
# $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
fi