updated on Thu Jan 26 16:09:46 UTC 2012
[aur-mirror.git] / geogebra-svn / geogebra.sh
bloba7ea39fcf12e591508f3c8659906c113f8895db7
1 #!/bin/sh
2 # simple script to start geogebra
4 func_usage()
6 cat << _USAGE
7 Usage: geogebra [Java-options] [GeoGebra-options] [FILE]
9 GeoGebra - Dynamic mathematics software
11 Java options:
12 -Xms<size> set initial Java heap size
13 -Xmx<size> set maximum Java heap size
15 GeoGebra options:
16 --help print this help message
17 --language=<iso_code> set language using locale code, e.g. en, de_AT
18 --showAlgebraInput=<boolean> show/hide algebra input field
19 --showAlgebraWindow=<boolean> show/hide algebra window
20 --showSpreadsheet=<boolean> show/hide spreadsheet
21 --fontSize=<number> set default font size
22 --showSplash=<boolean> enable/disable the splash screen
23 --enableUndo=<boolean> enable/disable Undo
24 _USAGE
27 # check for option --help and pass memory options to Java, others to GeoGebra
28 for i in "$@"; do
29 case "$i" in
30 --help | --hel | --he | --h )
31 func_usage; exit 0 ;;
32 esac
33 if [ $(expr match "$i" '.*-Xm') -ne 0 ]; then
34 if [ -z "$JAVA_OPTS" ]; then
35 JAVA_OPTS="$i"
36 else
37 JAVA_OPTS="$JAVA_OPTS $i"
39 shift $((1))
40 else
41 if [ $(expr match "$i" '.*--') -ne 0 ]; then
42 if [ -z "$GG_OPTS" ]; then
43 GG_OPTS="$i"
44 else
45 GG_OPTS="$GG_OPTS $i"
47 shift $((1))
50 done
52 # if memory not set, change to GeoGebra defaults
53 if [ $(expr match "$JAVA_OPTS" ".*-Xmx") -eq 0 ]; then
54 JAVA_OPTS="$JAVA_OPTS -Xmx512m"
57 if [ $(expr match "$JAVA_OPTS" ".*-Xms") -eq 0 ]; then
58 JAVA_OPTS="$JAVA_OPTS -Xms32m"
61 # run
62 exec java $JAVA_OPTS -jar /usr/share/java/geogebra/geogebra.jar $GG_OPTS "$@"