Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I find when I log in that the DISPLAY variable is set incorrectly as: /tmp/launch-qGGKPH/org.macports:0 (or similarly named temp file)

This may be related to the way I installed and then uninstall macports xorg-server. In any case this setting is preventing integration with X. Moreover, I find that sometimes the correct DISPLAY variable is 0:0 and other times 1:0 preventing hard coding.

How should I configure my environment to ensure the correct setting of DISPLAY is inherited by all process at log in? Perhaps this is matter of identifying how macports perturbed the default settings of my system?

share|improve this question

From a bit of research. X11 under Leopard is run from launchd this is not macports specific - it thus sets the name of the socket to the odd name you see in DISPLAY variable.

Thus you should not change DISPLAY see from Macworld forum Machints quoting XQuartz's author

More from the xquartz FAQ if you want to launch X11 manually and not via launchd

share|improve this answer

Did you have a particular reason for using macports to install a new X11 environment instead of using the one that comes with Mac OS X? If you don't specifically need the macports one, I'd recommend uninstalling it (just the X components, not all of macports) and then (re-)installing Apple's X11 environment. It's not installed by default, but it's on your Mac OS X Install DVD and you can install just that one component after the fact.

share|improve this answer
If you use a library from Macports - e.g. GTK that uses X11 you will need Macport's X11 – Mark Dec 1 '10 at 11:07
It also will still leave you with the DISPLAY with an odd name as it is a sockey – Mark Dec 2 '10 at 8:14
Indeed, the macports x11 came as a dependency on some other tools and overwrote the defaults. – SetJmp Dec 7 '10 at 20:17
I don't think macports overwrites the defaults except PATH - which ones di you think it changed? – Mark Dec 7 '10 at 23:30
up vote 0 down vote accepted

I was able to search and tinker with the launchd related configuration files until the problem was solved. The necessary information was given in the link supplied by user Mark:

share|improve this answer
For future other users: what did you need to tinker? (And what's wrong about Mark's answer that you could not accept that?) – Arjan Dec 7 '10 at 21:08
And why not use launchd and let DISPLAY be the socket name - what issues does this cause? – Mark Dec 7 '10 at 23:31

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .