Code

* packaging/macosx/ScriptExec/main.c, packaging/macosx/Resources/script:
[inkscape.git] / packaging / macosx / Resources / script
1 #!/bin/sh
2 #
3 # Author: Aaron Voisine <aaron@voisine.org>
4 # Inkscape Modifications: Michael Wybrow <mjwybrow@users.sourceforge.net>
6 CWD="`dirname \"$0\"`"
9 ps -wx -ocommand | grep -e '[X]11' > /dev/null
10 if [ "$?" != "0" -a ! -f ~/.xinitrc ]; then
11     echo "rm -f ~/.xinitrc" > ~/.xinitrc
12     sed 's/xterm/# xterm/' /usr/X11R6/lib/X11/xinit/xinitrc >> ~/.xinitrc
13 fi
15 cp -f "$CWD/bin/getdisplay.sh" /tmp/
16 rm -f /tmp/display.$UID
17 open-x11 /tmp/getdisplay.sh || \
18 open -a XDarwin /tmp/getdisplay.sh || \
19 echo ":0" > /tmp/display.$UID
21 while [ "$?" == "0" -a ! -f /tmp/display.$UID ]; do
22     sleep 1
23 done
24 export DISPLAY="`cat /tmp/display.$UID`"
26 ps -wx -ocommand | grep -e '[X]11' > /dev/null || exit 11
28 # Old OS X version specific test:
29 #
30 #VERSION=`/usr/bin/sw_vers | grep ProductVersion | cut -f2 -d'.'`
31 #if [ "$VERSION" -eq "4" ]; then
33 # Warn the user about time-consuming generation of fontconfig caches.
34 test -f ~/.inkscape/.fccache-new || exit 12
37 BASE="`echo "$0" | sed -e 's/\/Contents\/Resources\/script/\//'`"
38 cd "$BASE"
39 exec "$CWD/bin/inkscape" "$@"