|
|
|
Clear questions and runnable code get the best and fastest answer |
|
| PerlMonks |
Re^3: How to detect X?by legato (Monk) |
| on Feb 22, 2005 at 12:54 UTC ( [id://433426]=note: print w/replies, xml ) | Need Help?? |
This is an archived low-energy page for bots and other anonmyous visitors. Please sign up if you are a human and want to interact.
Aha, I missed the few key words in your node about calling a module, my apologies. As far as "a lot of extra work", it may be a simple application now, but damned if those things don't grow at the worst possible times. ;-) As far as X/CLI, the most reasonable algorithm is:
In other words, check the DISPLAY and try to connect to the X server; if that fails, use the CLI. (Also makes certain to handle the command line options to force X or CLI). Yes, this isn't 100%. Yes, there are more complex ways to do it. In reality, since you are allowing the user to force one or the other via a command-line, you needn't even try to connect to X. With unusual configurations where DISPLAY is set without X running (or vice-versa), the user simply needs to specify a force option on the command line. Anima Legato
In Section
Seekers of Perl Wisdom
|
|
||||||||||||||||||||||||