Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re^4: How to detect X?

by Anonymous Monk
on Feb 21, 2005 at 14:22 UTC ( [id://433054]=note: print w/replies, xml ) Need Help??


in reply to Re^3: How to detect X?
in thread How to detect X?

$ENV{DISPLAY} not being set if X is running is only one part of the problem - and the less problematic one, because in that case, it runs the command line version. The other problem is $ENV{DISPLAY} being set and X not running. Then it will try to launch an X application.

Replies are listed 'Best First'.
Re^5: How to detect X?
by husker (Chaplain) on Feb 21, 2005 at 23:02 UTC
    So can you not check for BOTH a non-empty DISPLAY *and* check the process table (via ps or whatever is handy) for the X process?
      In general, no. Because in general, the X server (which DISPLAY is pointing at) may not even be running on the local machine. You'd have to have some way of checking for a running X server process on some other machine on the network, which itself is in general a "hard" problem. You'd do better just to check if you can make an X connection directly to the specified X server.
        In general, no. Because in general, the X server (which DISPLAY is pointing at) may not even be running on the local machine.
        But then again I'm interested in making the GUI version start automatically only if the/a X server is running on the local machine (unless explicitly stated differently by the user on the cmd line).

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://433054]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others having an uproarious good time at the Monastery: (5)
As of 2024-09-07 14:55 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?
    erzuuli‥ 🛈The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.