Launch X11 apps from the Finder

Jan 20, '03 09:24:04AM

Contributed by: jk806

I was thrilled to see the X11 release package from apple. Finally, an easy and clean way to install X on my machine. Along with the gtk/gimp packages made available from the opendarwin.org people, I now have gimp and X11 installed and working great.

It was all so easy... but what I really wanted was to be able to start The Gimp from the Finder. So I whipped up a quick applescript to do just that. This should work, more or less for any X11 app you want to use. It will launch X11 if it's not already running, and then launch your X app.
Use Script Editor to save this applescript as an application... and viola! dockable Gimp.

tell application "Finder"
launch application "X11"
end tell

set results to do shell script "cd ~; DISPLAY=:0.0;
export DISPLAY; PATH=$PATH:/usr/local/bin; export PATH ;
/usr/local/bin/gimp > /dev/null 2>&1 &"
[Note: The "set results" bit is one long line; replace each line break with a single space.]

If you want to use this for something other than the gimp, just change the /usr/local/bin/gimp to the app you want to start.

Comments (20)


Mac OS X Hints
http://hints.macworld.com/article.php?story=20030120062404668