Question

According to this, for best results in Leopard my $DISPLAY variable should start with /tmp/launchd. Alas, my $DISPLAY variable is /tmp/launch-aLhnOW/:0

I do not set $DISPLAY in any of these ...

  • /private/etc/profile
  • /private/etc/bashrc
  • ~/.bash_profile
  • ~/.profile

... so I suspect there is some other configuration file that X11 is reading. Any suggestions?

I specifically need to ensure that it is not set anywhere. Per the linked article:

Starting X11.app from the dock will get you two icons, setting it to auto-launch is also a no-no, and if you have set DISPLAY in any of your configuration files you get a disaster.

Was it helpful?

Solution

I think your DISPLAY variable looks all right. I don't think it is being set by a configuration file.

Normally you have a launchd configuration file such as /System/Library/LaunchAgents/org.x.startx.plist. This contains a section:

    <key>Sockets</key>
            <dict>
                    <key>:0</key>
                            <dict>
                                    <key>SecureSocketWithKey</key>
                                            <string>DISPLAY</string>
                            </dict>
            </dict>

I believe this causes launchd to open a socket and set the DISPLAY variable to its path. When a program contacts this socket, startx is invoked by launchd.

OTHER TIPS

You should be able to set it in the ~/.MacOSX/environment.plist file. Details can be found here.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top