Gentoo Archives: gentoo-user

From: Donnie Berkholz <dberkholz@g.o>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] Test for X from cli
Date: Wed, 02 Aug 2006 03:32:27
Message-Id: 44D01B3D.3010607@gentoo.org
In Reply to: Re: [gentoo-user] Test for X from cli by "John J. Foster"
1 John J. Foster wrote:
2 > On Tue, Aug 01, 2006 at 03:43:12PM -0400, Philip Webb wrote:
3 >> 060801 John J. Foster wrote:
4 >>> In a bash script, how can I test whether the script itself is being run
5 >>> from a virtual terminal, or from an emulator like konsole within X?
6 >> 'echo $DISPLAY' returns ':0' from Konsole,
7 >> but nothing from a raw terminal called up via Ctl-Alt-F2 .
8 >>
9 > Of the different methods suggested, I like this one best.
10
11 This will also be set in ssh sessions with X forwarding turned on. You
12 might want to check whether you're in one of those as well.
13
14 Thanks,
15 Donnie
16 --
17 gentoo-user@g.o mailing list