Anders
Anders

Reputation: 6218

Detect if X is running and if it's usable for application

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

Upvotes: 0

Views: 166

Answers (1)

Ignacio Vazquez-Abrams
Ignacio Vazquez-Abrams

Reputation: 798706

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

Upvotes: 1

Related Questions