[Tutor] Finding out if we can use a graphical environment or not

Alan Gauld alan.gauld@blueyonder.co.uk
Wed Jul 16 14:14:01 2003


> > In X the typical approach is to check whether the DISPLAY
> > environment variable is set.
>
> OK. This is the second message that suggests that and it is less
> expensive than the 'try' approach. It also solves the problem to me.

But its not foolproof. eg. I set DISPLAY in my .login/.profile file
but I only start X when I need to. So the env var can be set but
X not running. I'd check a 'ps' listing for a process called 'X'
to be safe.

Alan G.