Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!

10.5: Stop X11 from opening xterm on launch UNIX
X11 has changed in 10.5 to an xorg-based Xserver. Also, /etc/X11 no longer exists. The X11 startup list is now in ~/Library » Preferences » org.x.X11_launcher.plist. This file gets created if it's not there, or if the format is wrong.

To stop xterm from starting, simply change it to run xhost:
defaults write org.x.X11_launcher app_to_run /usr/X11/bin/xhost
[robg adds: This hint was submitted with app_to_start as the key name, but that didn't work for me. When I opened the prefs file, I found the key was app_to_run. When I tried it with the new key name, it worked as expected.]
    •    
  • Currently 2.56 / 5
  You rated: 2 / 5 (9 votes cast)
 
[24,798 views]  

10.5: Stop X11 from opening xterm on launch | 18 comments | Create New Account
Click here to return to the '10.5: Stop X11 from opening xterm on launch' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
10.5: Stop X11 from opening xterm on launch
Authored by: wgscott on Nov 02, '07 08:14:10AM

Good hint, except it might be better to use /usr/bin/false



[ Reply to This | # ]
10.5: Stop X11 from opening xterm on launch
Authored by: A. Square on Nov 02, '07 08:21:35AM

When I used /usr/bin/false, the hint didn't work. X11 would no longer launch. The hint as published works fine, though.



[ Reply to This | # ]
10.5: Stop X11 from opening xterm on launch
Authored by: wgscott on Nov 02, '07 11:56:57AM

Sorry, try

/usr/bin/true

(false returns 1, true returns 0)



[ Reply to This | # ]
10.5: Stop X11 from opening xterm on launch
Authored by: xcgr on Nov 04, '07 10:42:00PM

Setting it to /usr/bin/true causes my X11 to not launch at all.



[ Reply to This | # ]
10.5: Stop X11 from opening xterm on launch
Authored by: dbs on Nov 02, '07 10:09:34AM

Try /usr/bin/true then.
xhost is a potentially dangerous command that controls what other machines can connect to your X server. In the worst case they can read any key you type into an X11 application if you give them access.



[ Reply to This | # ]
10.5: Stop X11 from opening xterm on launch
Authored by: moylek on Nov 04, '07 07:01:11AM

I tried to _change_ the value for apps_to_run from:
/usr/X11/bin/xterm
... to ...
/usr/X11/bin/xterm -geometry 70x2+0+0

And somehow _that_ causes X11 to fail to open:

[hooker:~/Library/Preferences] moylek% open -a /Applications/Utilities/X11.app
LSOpenFromURLSpec() failed with error -10810.

Weird. Yet that command runs just fine from the command line.

Also weird, I can't run "man xterm" etc.



[ Reply to This | # ]
10.5: Stop X11 from opening xterm on launch
Authored by: joebeone on Jan 04, '10 11:14:52AM

Hiya, the trick here is to either put those extra arguments in single quotes, like:

defaults write org.x.X11 app_to_run 'xterm -sb -sl 256'

or put any xterm (or whatever) -specific commands that you'd pass via the command-line via .xinitrc. The .xinitrc method allows triggering arbitrarily complex X11 start scenarios... so:

  1. do the defaults ... usr/bin/true thing.
  2. Put the xterm in your .xinitrc; my .xinitrc looks like this:
    xterm -geometry 80x35 -sb -rightbar -sl 2000 -fn lucidasanstypewriter-14 &
    exec quartz-wm


[ Reply to This | # ]
Seamless X11
Authored by: rhowell on Nov 02, '07 08:15:55AM

If you're launching X11 applications from the Terminal, there's no need to have X11 running prior. There's also no need to manually set your DISPLAY environment variable. X11 will launch automatically, will not open an xterm window, and will manage your X11 application.

I submitted this as a hint a few days ago, but it may still be at the bottom of the pile.



[ Reply to This | # ]
Seamless X11
Authored by: dbs on Nov 02, '07 10:11:34AM

Does this work for X11 connections over SSH? If so that would be wonderful.



[ Reply to This | # ]
Seamless X11
Authored by: fracai on Nov 02, '07 01:01:39PM

as long as you connect with "ssh -X" to enable display forwarding

---
i am jack's amusing sig file



[ Reply to This | # ]
Seamless X11
Authored by: adrianm on Nov 03, '07 12:42:52AM

This is an interesting hint (the pending one on the bottom of the pile).
You can just type xterm and X11 starts. Before, you needed open-x11 to be sure.

I noticed now that open-x11 is missing from 10.5, although the man page is still there.

Anyone else notice that switching to full screen no longer works? (cmd+opt+A)
And X11 apps don't work with Spaces?

At least not for me.

---
~/.sig: not found



[ Reply to This | # ]
Seamless X11
Authored by: sys0p on Jan 03, '08 05:16:45PM

brilliant ! Works even over ssh ...



[ Reply to This | # ]
10.5: Stop X11 from opening xterm on launch
Authored by: beniamino38 on Nov 06, '07 12:12:14PM
As others have said, using xhost doesn't seem a good idea from a security point of view. An alternative:

defaults write org.x.X11_launcher app_to_run /usr/X11/bin/xprop

[ Reply to This | # ]

10.5: Stop X11 from opening xterm on launch
Authored by: sao on Nov 12, '07 08:10:20AM
Another possibility would be to use xlsclients:

defaults write org.x.X11_launcher app_to_run /usr/X11/bin/xlsclients

(it doesn't hit the filesystem or produce any output when you use it to launch the server)

Please, read: "Leopard and X11" FAQs:
#35- To get rid of the inital xterm.
http://forums.macosxhints.com/showthread.php?t=80171&page=2



[ Reply to This | # ]
10.5: Seamless X11?
Authored by: kurowska on Nov 07, '07 01:58:24AM

Hi,

I try to launch a program from the Terminal. It complains the DISPLAY is not set. X11 does not run automatically on my Leopard. Any suggestions how to fix it?

Thanks!
Julia



[ Reply to This | # ]
10.5: Seamless X11?
Authored by: Mark Barton on Nov 12, '07 05:13:11AM
See http://www.macosxhints.com/article.php?story=20071028135730303 . I found that indeed I didn't get the behaviour described until I'd cleared an ancient and forgotten setting for $DISPLAY out of ~/.MacOSX/environment.plist .

[ Reply to This | # ]
10.5: Stop X11 from opening xterm on launch
Authored by: philonous on Dec 09, '07 06:16:38PM

I'm very miffed that it is missing, also. I would love to find out what has replaced it.



[ Reply to This | # ]
10.5: Stop X11 from opening xterm on launch
Authored by: RickoKid on Feb 22, '08 06:20:41AM
I tried this and nothing changed! After looking in the ~/Library/Preferences folder I noticed that I only had org.x.X11.plist not org.x.X11_Launcher.plist. I changed the command to the following and it worked!

defaults write org.x.X11 app_to_run /usr/bin/true

[ Reply to This | # ]