Mac Launching X11, xterm with command

GeeYouEye

macrumors 68000
Original poster
Dec 9, 2001
1,652
6
State of Denial
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.
 

khammack

macrumors regular
Sep 28, 2004
166
0
Portland, OR
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:
# start some nice programs

xterm &
You can add another 'xterm' command, suppose you want to run "top":

xterm &

xterm -e top &
-kev
 

GeeYouEye

macrumors 68000
Original poster
Dec 9, 2001
1,652
6
State of Denial
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. :)
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.