~drgeo-developers/drgeo/trunk

« back to all changes in this revision

Viewing changes to VMs/linux-mac-windows/vm-2010-07-13/DrGeo.app/drgeo.sh

  • Committer: Hilaire Fernandes
  • Date: 2012-01-27 21:15:40 UTC
  • Revision ID: hilaire.fernandes@gmail.com-20120127211540-912spf97bhpx6mve
Initial additions

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/bin/bash
 
2
# File:        squeak.sh (All-in-One version)
 
3
# Author:      Bert Freudenberg
 
4
# Description: Script to run Squeak from the all-in-one app structure
 
5
#              (based on Etoys-To-Go)
 
6
 
 
7
APP=`dirname "$0"`
 
8
APP=`cd "$APP";pwd`
 
9
OS=`uname -s`
 
10
CPU=`uname -m`
 
11
VM="$APP/Contents/Linux-i686/bin/squeak"
 
12
RESOURCES="$APP/Contents/Resources"
 
13
IMAGE="$RESOURCES/drgeo.image"
 
14
 
 
15
 
 
16
# icon
 
17
gvfs-set-attribute \
 
18
        "$0" \
 
19
        "metadata::custom-icon" \
 
20
        "file://$RESOURCES/drgeo.png" \
 
21
                2> /dev/null
 
22
 
 
23
 
 
24
showerror() {
 
25
    if [ -n "$DISPLAY" -a -x "`which kdialog 2>/dev/null`" ]; then
 
26
        kdialog --error "$1"
 
27
    elif [ -n "$DISPLAY" -a -x "`which zenity 2>/dev/null`" ]; then
 
28
        zenity --error --text "$1"
 
29
    else
 
30
        dialog --msgbox "$1" 0 0
 
31
    fi
 
32
}
 
33
 
 
34
if [ ! -x "$VM" ] ; then
 
35
    if [ ! -r "$VM" ] ; then
 
36
        showerror "This Squeak version does not support $OS-$CPU"
 
37
    else
 
38
        showerror "Squeak does not have permissions to execute"
 
39
    fi
 
40
fi
 
41
 
 
42
exec "$VM" "$IMAGE"