updated on Thu Jan 12 04:00:44 UTC 2012
[aur-mirror.git] / geogebra-beta-maxima / geogebra-beta-maxima.sh
blob6755b66c7006666a83f157d355b534c2a753d5c5
1 #!/bin/bash
2 #---------------------------------------------
3 # Script to start GeoGebra
4 #---------------------------------------------
6 #---------------------------------------------
7 # Define usage function
9 func_usage()
11 cat << _USAGE
12 Usage: geogebra [Java-options] [GeoGebra-options] [FILE]
14 GeoGebra - Dynamic mathematics software
16 Java options:
17 -Xms<size> Set initial Java heap size
18 -Xmx<size> Set maximum Java heap size
20 GeoGebra options:
21 --help Show this help message
22 --language=<iso_code> Set language using locale code, e.g. en, de_AT
23 --showAlgebraInput=<boolean> Show/hide algebra input field
24 --showAlgebraWindow=<boolean> Show/hide algebra window
25 --showSpreadsheet=<boolean> Show/hide spreadsheet
26 --fontSize=<number> Set default font size
27 --showSplash=<boolean> Enable/disable the splash screen
28 --enableUndo=<boolean> Enable/disable Undo
29 --CAS=[Maxima|MathPiper] Set Maxima/MathPiper as CAS engine
30 --maximaPath=<path> Set path to locally installed version of Maxima
31 _USAGE
34 #---------------------------------------------
35 # Check for option --help and pass memory options to Java, others to GeoGebra
37 for i in "$@"; do
38 case "$i" in
39 --help | --hel | --he | --h )
40 func_usage; exit 0 ;;
41 esac
42 if [ $(expr match "$i" '.*-Xm') -ne 0 ]; then
43 if [ -z "$JAVA_OPTS" ]; then
44 JAVA_OPTS="$i"
45 else
46 JAVA_OPTS="$JAVA_OPTS $i"
48 shift $((1))
49 else
50 if [ $(expr match "$i" '.*--') -ne 0 ]; then
51 if [ -z "$GG_OPTS" ]; then
52 GG_OPTS="$i"
53 else
54 GG_OPTS="$GG_OPTS $i"
56 shift $((1))
59 done
61 #---------------------------------------------
62 # If memory not set, change to GeoGebra defaults
64 if [ $(expr match "$JAVA_OPTS" '.*-Xmx') -eq 0 ]; then
65 JAVA_OPTS="$JAVA_OPTS -Xmx512m"
67 if [ $(expr match "$JAVA_OPTS" '.*-Xms') -eq 0 ]; then
68 JAVA_OPTS="$JAVA_OPTS -Xms32m"
71 #---------------------------------------------
72 # Run
74 exec java $JAVA_OPTS -jar "/usr/share/java/geogebra/geogebra.jar" --CAS=Maxima $GG_OPTS "$@"