Pick of the Week - Nov 10 [Show all picks]
Path Finder 5 - A feature-laden Finder replacement
Submit Hint Search The Forums LinksStatsPollsFAQHeadlinesRSS
12,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 4.00 / 5
  • 1
  • 2
  • 3
  • 4
  • 5
  (1 vote cast)
 
[15,737 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 whomever posted them. This site is not responsible for what they say.
10.5: Stop X11 from opening xterm on launch
Authored by: wgscott on Fri, Nov 2 2007 at 8:14AM PDT
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 Fri, Nov 2 2007 at 8:21AM PDT
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 Fri, Nov 2 2007 at 11:56AM PDT
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 Sun, Nov 4 2007 at 10:42PM PST
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 Fri, Nov 2 2007 at 10:09AM PDT
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 Sun, Nov 4 2007 at 7:01AM PST
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 Mon, Jan 4 2010 at 11:14AM PST

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 Fri, Nov 2 2007 at 8:15AM PDT
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 Fri, Nov 2 2007 at 10:11AM PDT
Does this work for X11 connections over SSH? If so that would be wonderful.

[ Reply to This | # ]
Seamless X11
Authored by: fracai on Fri, Nov 2 2007 at 1:01PM PDT
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 Sat, Nov 3 2007 at 12:42AM PDT
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 Thu, Jan 3 2008 at 5:16PM PST
brilliant ! Works even over ssh ...

[ Reply to This | # ]
10.5: Stop X11 from opening xterm on launch
Authored by: beniamino38 on Tue, Nov 6 2007 at 12:12PM PST
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 Mon, Nov 12 2007 at 8:10AM PST
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 Wed, Nov 7 2007 at 1:58AM PST
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 Mon, Nov 12 2007 at 5:13AM PST
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 Sun, Dec 9 2007 at 6:16PM PST
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 Fri, Feb 22 2008 at 6:20AM PST
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 | # ]