1
0
mirror of synced 2026-01-18 01:22:09 +00:00

reduce options to simplify

This commit is contained in:
Larry Masinter 2020-11-26 21:21:57 -08:00
parent 21fe7fc9c4
commit 01a532491b
2 changed files with 51 additions and 166 deletions

File diff suppressed because one or more lines are too long

View File

@ -1,36 +1,32 @@
#!/bin/sh
#
# Run Medley
#
# Syntax: run-medley [-nogreet][-xns][-noxns] [-geometry pixelgeometry]
# [-display xdisplay-device] [-screensize pixelgeometry]
# [-raw] [-t xtimeout][-prog executable-program]
# [-vmem savevmemfilename] |
# [-m memorylimit] [-kbd keyboardtype] [-key key]
# [sysoutfilename | -lfg | -lisp | -full |
# -{name of any in the sysouts} ]
# Syntax: run-medley [options] [sysout name]
# Options
# -nogreet ; just run sysout
# -greet greetfile ; which greetfile to use
# -geometry pixelgeometry
# -screensize pixelgeometry
# -display xdisplay-device e.g. :0
# -vmem savevmemfilename
# current limits the size of the screen to
# 65536*32 bits so 1600x1200 will do
#
# -xns means leave unix xns running
# -noxns means suppress Lisp xns.
# LDESRCESYSOUT
# LDESOURCESYSOUT SYSOUT full-file name you want to run
# LDEDESTSYSOUT SYSOUT name for destination of SAVEVM/LOGOUT
# LDEKBDTYPE
# type2
# type3
# type4
# jle
# as3000j
# LDEFILETIMEOUT
export HOSTNAME=`hostname`
export OSVERSION=`uname -r`
# Environment variables set
# Directory variables are accessible from Lisp via UNIX-GETENV
# LDESRCESYSOUT SYSOUT full-file name you want to run
# LDESOURCESYSOUT
# LDEDESTSYSOUT name for destination of SAVEVM/LOGOUT
# MEDLEYDIR
if [ -z "$MEDLEYDIR" ] ; then export MEDLEYDIR=`pwd`; fi
if [ ! -d $MEDLEYDIR/loadups ] ; then
echo MEDLEYDIR not found: "$MEDLEYDIR"
@ -45,44 +41,15 @@ if [ -z "$MAIKODIR" ] ; then
fi
fi
export LDEINIT="$MEDLEYDIR/greetfiles/SIMPLE-INIT"
mem="-m 256" # Default, has to be set
#geometry="-g 1060x790"
# MBA screensize
geometry="-g 1440x900"
screensize="-sc 1440x900"
export LDEINIT="$MEDLEYDIR/greetfiles/SIMPLE-INIT"
export LDEKBDTYPE=x
ICONSPEC=" "
export LDEFILETIMEOUT=60
export TAKEXNSDOWN=0
export LDELISPXNS=0
#default is no lispxns
export LDEDESTSYSOUT=~/lisp.virtualmem
while [ "$#" -ne 0 ]; do
case "$1" in
"-m")
mem="-m $2"
shift
;;
"-xlisp")
export LDESRCESYSOUT="$MEDLEYDIR/loadups/xlisp.sysout"
;;
"-lisp")
export LDESRCESYSOUT="$MEDLEYDIR/loadups/lisp.sysout"
;;
"-xfull35")
export LDESRCESYSOUT="$MEDLEYDIR/loadups/xfull35.sysout"
;;
"-full")
export LDESRCESYSOUT="$MEDLEYDIR/loadups/full.sysout"
;;
"-lfg" | "-lfg35" | "-xlfg35")
export LDESRCESYSOUT="$LFGPARSERDIR/release/lfg35.sysout"
ICONSPEC="-iconbitmap $LFGPARSERDIR/release/lfg.xbm -icontitle Xerox"
;;
"-nogreet")
export LDEINIT=""
;;
@ -90,22 +57,11 @@ while [ "$#" -ne 0 ]; do
export LDEINIT="$2"
shift
;;
"-xns")
export TAKEXNSDOWN=1
export LDELISPXNS=1
;;
"-noxns")
export TAKEXNSDOWN=0
export LDELISPXNS=0
;;
"-raw")
unset DISPLAY
;;
"-geometry")
geometry="-g $2"
shift
;;
"-screensize")
"-screensize")
screensize="-sc $2"
shift
;;
@ -113,113 +69,42 @@ while [ "$#" -ne 0 ]; do
export DISPLAY=$2
shift
;;
"-t")
xtimeout=$2
shift
;;
"-prog")
progparam=$2
shift
;;
"-vmem")
export LDEDESTSYSOUT=$2
shift
;;
"-kbd")
export LDEKBDTYPE=$2
shift
;;
"-vmem")
LDEDESTSYSOUT=$2
shift
;;
"-"*)
echo unrecognized option "$1"
exit 1
;;
*)
# anything else is a public sysout name
case "$1" in
"-"*)
name=`expr substr $1 2 999`
export LDESRCESYSOUT="$MEDLEYDIR/loadups/${name}.sysout"
;;
*) # not an option so must be a sysout name
export LDESRCESYSOUT=$1 ;;
esac
;;
# not an option so must be a sysout name
export LDESRCESYSOUT=$1
;;
esac
shift
done
if [ -z "$LDEDESTSYSOUT" ] ; then
if [ -f /$HOSTNAME/$LOGNAME/lisp.virtualmem ]; then
export LDEDESTSYSOUT=/$HOSTNAME/$LOGNAME/lisp.virtualmem
elif [ -f ~/lisp.virtualmem ]; then
export LDEDESTSYSOUT=~/lisp.virtualmem
elif [ -d /$HOSTNAME/$LOGNAME ]; then
export LDEDESTSYSOUT=/$HOSTNAME/$LOGNAME/lisp.virtualmem
fi
fi
if [ -z "$LDESRCESYSOUT" ] ; then
export LDESRCESYSOUT="$LDEDESTSYSOUT"
if [ -f "$LDEDESTSYSOUT" ] ; then
export LDESRCESYSOUT="$LDEDESTSYSOUT"
fi
else
export LDESRCSYSOUT="$MEDLEYDIR/loadups/xfull35.sysout" ;
fi
# if [ ! -z "$LDEKBDTYPE" ] ; then
# # switch (`/usr/bin/hostinfo keyboardtype`)
# # endsw
# fi
echo "keyboard type is " $LDEKBDTYPE
export INMEDLEY=1
echo "sysout is " $LDESRCESYSOUT
#version = `medley-lisp-version $LDESRCESYSOUT`
version="35010"
if [ "$LDELISPXNS" -ne "0" ] ; then
prog="ldeether"
else
prog="lde"
echo "running without xns protocols"
fi
case "$version" in
"35000")
version="3.5"
;;
"35010")
version="3.501"
;;
*)
version="3.5"
;;
esac
echo "using emulator version $version"
case "$version" in
"3.5"|"3.501")
export PATH=.:"$PATH"
old_wd=`pwd`
cd "$MAIKODIR"/bin
export PATH=$MAIKODIR/`osversion`.`machinetype`:"$PATH"
cd $old_wd
# if ${?DISPLAY} then # we are running under X
$prog $mem $geometry $screensize $ICONSPEC
# else $prog $mem
# endif
;;
*) echo HMM
esac
#
# Now we are done, so clean up after ourselves
#
cleanup:
# if ${?DISPLAY} then
# # do X cleanup
# else
# # reset
# endif
prog="lde"
oldpath="$PATH"
export PATH=.:"$PATH"
cd "$MAIKODIR"/bin
export PATH=$MAIKODIR/`osversion`.`machinetype`:"$oldpath"
cd $old_wd
$prog $geometry $screensize -t "Medley Interlisp @ https://Interlisp.org"