Question

On a POSIX-compliant system, how do one detect if X is running and if it's usable for the application.

Was it helpful?

Solution

Check if $DISPLAY has a value, and try to connect the the server at that address.

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