[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

How to test whether script runs under X11



> I assumed that DISPLAY was only set when X11 is running, but that is not
> true.  My system however has HOSTDISPLAY unset when I'm on the console, and
> set when I run X11.  Is that a general feature?  If not, how can I detect (in
> a postinst) whether I am running under X11 or not?

I frequently set DISPLAY when I want a program to run under X11, even
though I'm not typing into an X window.  This is very useful when trying
to bring up a new configuration, and things aren't talking to each other.

[Or, the other day, I had a solaris machine that wouldn't talk to my
linux box because of some packet filtering rules.  But I needed to
run some linux code from the solaris console.  So I made the solaris
machine accept X connections from linux, then walked over to the linux
box, set DISPLAY and fired up a couple xterms in the background.]

Anyways, point is, it's reasonable to assume that if DISPLAY is set
that the user wants that x display to be used by x aware programs.

-- 
Raul


--
TO UNSUBSCRIBE FROM THIS MAILING LIST: e-mail the word "unsubscribe" to
debian-devel-REQUEST@lists.debian.org . Trouble? e-mail to Bruce@Pixar.com


Reply to: