Gentoo Archives: gentoo-user

From: cdemarco@××××××××.fm
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] Can a script tell if it's running under X?
Date: Mon, 06 Dec 2004 02:08:40
Message-Id: 20041206020748.GA30358@bugs.md.com.my
In Reply to: Re: [gentoo-user] Can a script tell if it's running under X? by Nick Rout
1 On Sun, Dec 05, 2004 at 10:43:05AM +1300, Nick Rout wrote:
2
3 > One way is test if $DISPLAY is set, if it is then you are running in
4 > X
5
6 If you login via SSH and have X forwarding enabled, you might not want
7 to burn bandwidth on an X app.
8
9
10 The *safest* way IMHO is to set an env var, e.g. "GOT_X='yes'" in your
11 .xsession/.xinitrc!
12
13
14 --
15 % You are in a maze of twisty passages, all alike.
16 Christopher DeMarco <cdemarco@××××××××.fm>
17 PGP public key ID 0x2E76CF5C @ pgp.mit.edu
18 +6012 232 2106

Replies

Subject Author
Re: [gentoo-user] Can a script tell if it's running under X? Iain Buchanan <iaindb@××××××××××××.au>