3 # Modified from: Aaron Voisine <aaron@voisine.org>
6 TMP
=/tmp
/$UID/TemporaryItems
8 ps
-wx -ocommand |
grep -e '[X]11.app' > /dev
/null
9 if [ "$?" != "0" -a ! -f ~
/.xinitrc
]; then
10 echo "rm -f ~/.xinitrc" > ~
/.xinitrc
11 sed 's/xterm/# xterm/' /usr
/X11R
6/lib
/X11
/xinit
/xinitrc
>> ~
/.xinitrc
15 cat << __END_OF_GETDISPLAY_SCRIPT__ > "$TMP/getdisplay.sh"
19 if [ "\$DISPLAY"x == "x" ]; then
20 echo :0 > "$TMP/display"
22 echo \$DISPLAY > "$TMP/display"
24 __END_OF_GETDISPLAY_SCRIPT__
25 chmod +x
"$TMP/getdisplay.sh"
27 open-x11
$TMP/getdisplay.sh || \
28 open
-a XDarwin
$TMP/getdisplay.sh || \
29 echo ":0" > $TMP/display
31 while [ "$?" == "0" -a ! -f $TMP/display
];
33 #echo "Waiting for display $TMP/display"
36 export "DISPLAY=`cat $TMP/display`"
38 ps
-wx -ocommand |
grep -e '[X]11' > /dev
/null ||
exit 11
41 echo "$@" > /tmp
/arguments.log
42 if echo $1 |
grep -- "^-psn_"; then
45 exec "$CWD/bin/@CPACK_EXECUTABLE_NAME@" "$@" > /tmp
/slicer.output
2>&1