Gentoo Archives: gentoo-user

From: Iain Buchanan <iaindb@××××××××××××.au>
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 04:20:06
Message-Id: 1102306773.19641.17.camel@orpheus
In Reply to: Re: [gentoo-user] Can a script tell if it's running under X? by cdemarco@fastmail.fm
1 On Mon, 2004-12-06 at 10:07 +0800, cdemarco@××××××××.fm wrote:
2 > On Sun, Dec 05, 2004 at 10:43:05AM +1300, Nick Rout wrote:
3 >
4 > > One way is test if $DISPLAY is set, if it is then you are running in
5 > > X
6 >
7 > If you login via SSH and have X forwarding enabled, you might not want
8 > to burn bandwidth on an X app.
9
10 If you don't want to use X in this case, then you probably won't have
11 $DISPLAY set :) Its a good idea IMHO to stick to conventions - how
12 annoying would it be if each app had its own $DISPLAY like variable that
13 you had to set?
14
15 You can always add a --nox or -nw or whatever (like emacs etc) if the
16 user wants to override it...
17
18 HTH,
19 --
20 Iain Buchanan <iaindb at netspace dot net dot au>
21
22 You know you're using the computer too much when:
23 u type amd instead of and
24 -- DEaigo
25
26
27 --
28 gentoo-user@g.o mailing list