mailing-list for TeXmacs Users

Text archives Help


Re: [TeXmacs] TeXmacs as a Maxima frontend on Mac OS X


Chronological Thread 
  • From: Tobia <address@hidden>
  • To: address@hidden
  • Subject: Re: [TeXmacs] TeXmacs as a Maxima frontend on Mac OS X
  • Date: Fri, 1 Jun 2007 20:47:42 +0200

Peter Rapčan wrote:
> Could you please expand on how you wrapped TeXmacs in an application
> to be usable in the dock? Can this be done in a dynamical way, with no
> need to repeat the whole process after updating TeXmacs via fink?

Sure!

First of all, you need to set up you PATH so that it is available to
graphical programs too, otherwise your TeXmacs won't even start.

Paste the following lines into a terminal:

mkdir ~/.MacOSX && cat > ~/.MacOSX/environment.plist << EOF
<plist version="1.0">
<dict>
<key>PATH</key>
<string>$PATH</string>
</dict>
</plist>
EOF

If it fails, complaining that the file already exists, then you should
manually merge your current PATH into it by means of a text editor.

In any case you need to log out and log back in for it to take effect.


Then create the application wrapper:

- Download Platypus http://www.sveinbjorn.org/platypus/
- Open it and type TeXmacs as the Application Name
- Open www.texmacs.org in Safari (other browsers won't work here) and
drag the Gnu image into Platypus' icon drop box
- Make sure the script type is set to Shell and click New
- Paste the following and click Save:

------------------------------------------------------------------------
#!/bin/sh

CWD="`dirname \"$0\"`"
TMP=/tmp/$UID/TemporaryItems

mkdir -p $TMP
cat >"$TMP/getdisplay.sh" <<EOF
#!/bin/sh

if [ "$DISPLAY"x == "x" ]; then
echo :0 > /tmp/$UID/TemporaryItems/display
else
echo $DISPLAY > /tmp/$UID/TemporaryItems/display
fi
EOF
chmod 755 "$TMP/getdisplay.sh"

rm -f $TMP/display
open-x11 $TMP/getdisplay.sh || \
open -a XDarwin $TMP/getdisplay.sh || \
echo ":0" > $TMP/display

while [ "$?" == "0" -a ! -f $TMP/display ]; do sleep 1; done
export "DISPLAY=`cat $TMP/display`"

ps -wx -ocommand | grep -e '[X]11' > /dev/null || exit 11

cd ~/
exec texmacs
------------------------------------------------------------------------

(borrowed from Gimp.app by the way)

- Click Create and save as "TeXmacs"

Now you can double-click it to launch TeXmacs (opening X11 if needed),
put it in the dock, click-and-hold it and choose Quit, and the black
triangle in the dock will tell you if TeXmacs is currently running!

Alas, other things won't work, such as hiding it or bringing it to the
foreground, because TeXmacs's window itself belongs to the X11 app.
(Therefore you can do those things on the X11 icon.)


If your X11 spawns a spurious XTerm every time it starts and you don't
like it, you can paste the following lines into a terminal:

cat > ~/.xinitrc << EOF
xrdb -merge /etc/X11/xinit/.Xresources
xmodmap /etc/X11/xinit/.Xmodmap
xrdb -merge ~/.Xresources
xmodmap ~/.Xmodmap
exec quartz-wm
EOF


> Is there a way to do the above in such a manner that one sees the
> direct output (say in a separate window) as you do when you run
> TeXmacs from Xterm?

Of course! Just change the last line of the Platypus script above to:

exec xterm -e texmacs


HTH
Tobia


  • Re: [TeXmacs] TeXmacs as a Maxima frontend on Mac OS X, Tobia, 06/01/2007

Archive powered by MHonArc 2.6.19.

Top of page