Launching X11, xterm with command

Discussion in 'Mac Programming' started by GeeYouEye, Mar 21, 2005.

  1. GeeYouEye macrumors 68000

    GeeYouEye

    Joined:
    Dec 9, 2001
    Location:
    State of Denial
    #1
    Does anyone know a way to launch Apple's X11, and then tell the xterm that shows up to run a command? I have the equivalent working for Terminal.app (via NSTask), but I really need to be able to do the same thing for X11. I'm not opposed to kludgy solutions, but so far I've come up with nothing.
     
  2. khammack macrumors regular

    Joined:
    Sep 28, 2004
    Location:
    Portland, OR
    #2
    No need for a kludge. Launch a terminal and run these commands:

    $ cp /etc/X11/xinit/xinitrc .xinitrc
    $ chmod +x .xinitrc

    Now edit .xinitrc, and find this section:
    You can add another 'xterm' command, suppose you want to run "top":

    -kev
     
  3. GeeYouEye thread starter macrumors 68000

    GeeYouEye

    Joined:
    Dec 9, 2001
    Location:
    State of Denial
    #3
    Thanks, but I guess I wasn't being clear. I meant how to programmaticly do that in Cocoa, but no worries, I've got it working now. :)
     

Share This Page