Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

GeeYouEye

macrumors 68000
Original poster
Dec 9, 2001
1,669
10
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,669
10
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.