Launch X11 GUI app via Applescipt/Xcode?

Discussion in 'Mac Programming' started by noire anqa, Apr 5, 2011.

  1. macrumors regular

    Joined:
    Aug 20, 2010
    #1
    Hi there,

    Is there any way to run an X11 gui app by launching it from a native mac app, cocoa or applescript cocoa?

    We're hoping to distribute a mac build.

    Cheers.
     
  2. Moderator

    balamw

    Staff Member

    Joined:
    Aug 16, 2005
    Location:
    New England
    #2
    FWIW MATLAB does this. Their launcher starts X11 and then opens the other Windows.

    I suppose they may use system or NSTask to launch X11.

    B
     
  3. macrumors 65816

    jiminaus

    Joined:
    Dec 16, 2010
    Location:
    Sydney
    #3
    X11.app will autolaunch as soon as a program tried to connect to it. You'll notice on Mac OS X that DISPLAY is not the usually 127.0.0.1:0, but a path to a filesystem socket. When this socket is opened X11.app will launch. Try catting the filesystem socket and you'll launch X11.app.
     
  4. Moderator

    balamw

    Staff Member

    Joined:
    Aug 16, 2005
    Location:
    New England
    #4
    That's neat and it does work!

    cat $DISPLAY opens X11.

    B
     
  5. thread starter macrumors regular

    Joined:
    Aug 20, 2010
    #5
    That's genius ..

    Thanks for all the help.
     

Share This Page