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


Click here to return to the 'Be careful setting your display' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Be careful setting your display
Authored by: EddEdmondson on Sep 28, '05 08:56:34AM
I have to say this every time a comment like this comes out...

Don't set your DISPLAY to 0!

It's the cause of innumerable hard-to-diagnose problems because it's a fundamentally broken assumption. It breaks when you ssh in somewhere (as the poster of this hint has noticed) and it also breaks on multi-user Macs, and in some other less common situations.

If you must have your DISPLAY variable set in non-X11 applications (which is the situation when you need to have something like the snippet of code in the hint) then use a method that not only checks that it isn't already set, but which then checks for what value it should take. There are several ways of doing this. One is to use open-x11 to open a script from inside X11.app that writes out the DISPLAY setting to some file (this is the method used by Gimp.app for example) or by searching /tmp/.X11-unix/ for the file with the appropriate ownership (see this article).

[ Reply to This | # ]

Be careful setting your display
Authored by: n8gray on Sep 28, '05 12:42:55PM

Thank you! I was about to say the same thing...



[ Reply to This | # ]