Firstly, what is the best/simplest way to detect if X11 is running and available for a python script.
parent process?
session leader?
X environment variables?
other?
Secondly, I would like to have a utility (python script) to present a gui if available, otherwise use a command line backed tool.
Off the top of my head I thought of this
-main python script (detects if gui is available and launches appropriate script)
-gui or command line python script starts
-both use a generic module to do actual work
I am very open to suggestions to simplify this.