lib/scripts/isa-xterm
changeset 2712 44a657985de1
parent 2702 4167688e58aa
child 2713 7231c1e89706
equal deleted inserted replaced
2711:098f9ce0541a 2712:44a657985de1
     1 #!/bin/bash -norc
     1 #!/bin/bash -x
     2 #
     2 #
     3 # $Id$
     3 # $Id$
     4 #
     4 #
     5 # Isabelle within an xterm.
     5 # Isabelle within an xterm.
     6 
     6 
     7 # FIXME startup prefix (ISABELLE_COMMAND_LINE !?)
       
     8 
     7 
     9 ## diagnostics
     8 ## diagnostics
    10 
     9 
    11 PRG=$(basename $0)
    10 PRG=$(basename $0)
    12 
    11 
    15   echo
    14   echo
    16   echo "Usage: $PRG [OPTIONS] [--] [CMDLINE]"
    15   echo "Usage: $PRG [OPTIONS] [--] [CMDLINE]"
    17   echo
    16   echo
    18   echo "  Options are:"
    17   echo "  Options are:"
    19   echo "    -g GEOM      main window geometry (default 80x60)"
    18   echo "    -g GEOM      main window geometry (default 80x60)"
       
    19   echo "    -p TEXT      pass text (options etc.) to isabelle session"
    20   echo "    -s BOOL      symbolic font output? (default true)"
    20   echo "    -s BOOL      symbolic font output? (default true)"
    21 #FIXME
       
    22 #  echo "    -r BOOL      actually run isabelle? (default true)"
       
    23   echo
    21   echo
    24   echo "  Starts Isabelle within an xterm window. CMDLINE is passed"
    22   echo "  Starts Isabelle within an xterm window. CMDLINE is passed"
    25   echo "  directly to the isabelle session."
    23   echo "  directly to the isabelle session."
    26   echo
    24   echo
    27   exit 1
    25   exit 1
    37 ## process command line
    35 ## process command line
    38 
    36 
    39 # options
    37 # options
    40 
    38 
    41 MAINGEOM="80x60"
    39 MAINGEOM="80x60"
       
    40 PASS=""
    42 SYMBOLS="true"
    41 SYMBOLS="true"
    43 RUN="true"
       
    44 
    42 
    45 while getopts "g:r:s:" OPT
    43 while getopts "g:p:s:" OPT
    46 do
    44 do
    47   case "$OPT" in
    45   case "$OPT" in
    48     g)
    46     g)
    49       MAINGEOM="$OPTARG"
    47       MAINGEOM="$OPTARG"
    50       ;;
    48       ;;
    51     r)
    49     p)
    52       RUN="$OPTARG"
    50       PASS="$PASS $OPTARG"
    53       ;;
    51       ;;
    54     s)
    52     s)
    55       SYMBOLS="$OPTARG"
    53       SYMBOLS="$OPTARG"
    56       ;;
    54       ;;
    57     \?)
    55     \?)
    63 shift $(($OPTIND - 1))
    61 shift $(($OPTIND - 1))
    64 
    62 
    65 
    63 
    66 ## main
    64 ## main
    67 
    65 
    68 if [ -z "$RUN" -o "$RUN" = false ]; then
       
    69   RUN=""
       
    70 else
       
    71   RUN=true
       
    72 fi
       
    73 
       
    74 if [ -z "$SYMBOLS" -o "$SYMBOLS" = false ]; then
    66 if [ -z "$SYMBOLS" -o "$SYMBOLS" = false ]; then
    75   if [ -z "$RUN" ]; then
    67   exec xterm -T Isabelle -n Isabelle -geometry "$MAINGEOM" -e $ISABELLE $PASS "$@"
    76     exec xterm -T Isabelle -n Isabelle -geometry "$MAINGEOM"
       
    77   else
       
    78     exec xterm -T Isabelle -n Isabelle -geometry "$MAINGEOM" -e $ISABELLE "$@"
       
    79   fi
       
    80 else
    68 else
    81   $ISATOOL installfonts
    69   $ISATOOL installfonts
    82   if [ -z "$RUN" ]; then
       
    83     exec xterm -T Isabelle -n Isabelle -geometry "$MAINGEOM" -fn isacr14 \
       
    84       -xrm "*fontMenu.Label: Isabelle fonts" \
       
    85       -xrm "*fontMenu*font1*Label: Large" \
       
    86       -xrm "*VT100*font1: isacb24" \
       
    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   else
       
    98     exec xterm -T Isabelle -n Isabelle -geometry "$MAINGEOM" -fn isacr14 \
    70     exec xterm -T Isabelle -n Isabelle -geometry "$MAINGEOM" -fn isacr14 \
    99       -xrm "*fontMenu.Label: Isabelle fonts" \
    71       -xrm "*fontMenu.Label: Isabelle fonts" \
   100       -xrm "*fontMenu*font1*Label: Large" \
    72       -xrm "*fontMenu*font1*Label: Large" \
   101       -xrm "*VT100*font1: isacb24" \
    73       -xrm "*VT100*font1: isacb24" \
   102       -xrm "*fontMenu*font2*Label:" \
    74       -xrm "*fontMenu*font2*Label:" \
   107       -xrm "*VT100*font4:" \
    79       -xrm "*VT100*font4:" \
   108       -xrm "*fontMenu*font5*Label:" \
    80       -xrm "*fontMenu*font5*Label:" \
   109       -xrm "*VT100*font5:" \
    81       -xrm "*VT100*font5:" \
   110       -xrm "*fontMenu*font6*Label:" \
    82       -xrm "*fontMenu*font6*Label:" \
   111       -xrm "*VT100*font6:" \
    83       -xrm "*VT100*font6:" \
   112       -e $ISABELLE -m symbols "$@"
    84       -e $ISABELLE -m symbols $PASS "$@"
   113   fi
    85   fi
   114 fi
    86 fi