From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <gentoo-user-return-94785-arch-gentoo-user=gentoo.org@lists.gentoo.org>
Received: (qmail 2176 invoked from network); 4 Dec 2004 21:45:38 +0000
Received: from smtp.gentoo.org (156.56.111.197)
  by lists.gentoo.org with AES256-SHA encrypted SMTP; 4 Dec 2004 21:45:38 +0000
Received: from lists.gentoo.org ([156.56.111.196] helo=parrot.gentoo.org)
	by smtp.gentoo.org with esmtp (Exim 4.41)
	id 1Cahik-0000QR-7B
	for arch-gentoo-user@lists.gentoo.org; Sat, 04 Dec 2004 21:45:38 +0000
Received: (qmail 9137 invoked by uid 89); 4 Dec 2004 21:45:21 +0000
Mailing-List: contact gentoo-user-help@gentoo.org; run by ezmlm
Precedence: bulk
List-Post: <mailto:gentoo-user@gentoo.org>
List-Help: <mailto:gentoo-user-help@gentoo.org>
List-Unsubscribe: <mailto:gentoo-user-unsubscribe@gentoo.org>
List-Subscribe: <mailto:gentoo-user-subscribe@gentoo.org>
List-Id: Gentoo Linux mail <gentoo-user.gentoo.org>
Reply-To: gentoo-user@lists.gentoo.org
X-BeenThere: gentoo-user@gentoo.org
Received: (qmail 10403 invoked from network); 4 Dec 2004 21:45:21 +0000
DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws;
        s=beta; d=gmail.com;
        h=received:return-path:message-id:date:from:user-agent:x-accept-language:mime-version:to:subject:references:in-reply-to:x-enigmail-version:x-enigmail-supports:content-type;
        b=sobZSRpCTfQRPQQBqfTBrkfUrE2YbtnSZWf4jTr1toLeiLFeNFjLLdDsFJ7vYDCt5PNL6b31TL7Et7SBPYjeuC1uSufk1e7EezsNTmRDNiqI63iT1L0zB2aGclOin9/qxJQjyRlgyr7fmvBvS6hL/Yv3Ngeiuwfuav+C1m/DjGQ=
Message-ID: <41B22FE8.2070107@gmail.com>
Date: Sat, 04 Dec 2004 23:45:12 +0200
From: Matan Peled <chaosite@gmail.com>
User-Agent: Mozilla Thunderbird 0.9 (X11/20041129)
X-Accept-Language: en-us, en
MIME-Version: 1.0
To:  gentoo-user@lists.gentoo.org
References: <9acccfe5041204133432d7a3e@mail.gmail.com>
In-Reply-To: <9acccfe5041204133432d7a3e@mail.gmail.com>
X-Enigmail-Version: 0.89.0.0
X-Enigmail-Supports: pgp-inline, pgp-mime
Content-Type: multipart/signed; micalg=pgp-sha1;
 protocol="application/pgp-signature";
 boundary="------------enig961ED9560D9966EC9B5E7B5A"
Subject: Re: [gentoo-user] Can a script tell if it's running under X?
X-Archives-Salt: 0f31ac0e-2a14-493a-b3ed-020f1ebcff17
X-Archives-Hash: 6c8f7b83225a32d77fa326b94d7275f6

--------------enig961ED9560D9966EC9B5E7B5A
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit

Kevin O'Gorman wrote:

>Is there a way for a script (bash, for instance) to know
>if it's running under X, such as in an xterm or konsole?
>
>I want to have scripts that run graphical tools if the
>infrastructure is present, and text tools otherwise.
>For me this is particularly useful for tools I don't use
>all that often, and can forget that a graphical version
>exists.
>
>++ kevin
>
>  
>
Another way would be to check ${TERM} - on a tty, its "linux", and in X 
it specifies the terminal emulator (rxvt, xterm, Eterm, etc.).

--------------enig961ED9560D9966EC9B5E7B5A
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: OpenPGP digital signature
Content-Disposition: attachment; filename="signature.asc"

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.6 (GNU/Linux)

iD8DBQFBsi/rA7Qvptb0LKURAibxAJ0dvaW2EOSXy8h69Nn1F3jp/MYSgQCdEsj+
Jhfu3nr+yOwRBfH61VRQPEw=
=hhHY
-----END PGP SIGNATURE-----

--------------enig961ED9560D9966EC9B5E7B5A--