in reply to Re: How to detect X?
in thread How to detect X?
As has been said many times already - use $ENV{DISPLAY}. If it is set, but there is no actual display at the place pointed to by this environment variable, then the user is set up incorrectly. Lots of applications will fail, not just yours. If it is not set, but there is an actual X server available, it's probably because the user wants to use the text mode version. So don't go looking for it.Thank you for your insightful and informed cmts. I will certainly follow your advice. However what I'm bothered most is having the GUI version fail because there's not actually an X server running even if DISPLAY is set as if there were. In that case still checking for success with an eval() (after checking DISPLAY, that is) would be lightweight enough and seems to be appropriate. Do you see any possible negative drawback with this approach?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: How to detect X?
by Tanktalus (Canon) on Feb 22, 2005 at 15:03 UTC |