From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 28384 invoked from network); 4 Dec 2004 21:42:04 +0000 Received: from smtp.gentoo.org (156.56.111.197) by lists.gentoo.org with AES256-SHA encrypted SMTP; 4 Dec 2004 21:42:04 +0000 Received: from lists.gentoo.org ([156.56.111.196] helo=parrot.gentoo.org) by smtp.gentoo.org with esmtp (Exim 4.41) id 1CahfI-0002oK-Ay for arch-gentoo-user@lists.gentoo.org; Sat, 04 Dec 2004 21:42:04 +0000 Received: (qmail 19838 invoked by uid 89); 4 Dec 2004 21:41:48 +0000 Mailing-List: contact gentoo-user-help@gentoo.org; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail Reply-To: gentoo-user@lists.gentoo.org X-BeenThere: gentoo-user@gentoo.org Received: (qmail 14498 invoked from network); 4 Dec 2004 21:41:47 +0000 Date: Sun, 05 Dec 2004 10:43:05 +1300 From: Nick Rout In-reply-to: <9acccfe5041204133432d7a3e@mail.gmail.com> To: gentoo-user@lists.gentoo.org Message-id: <1102196585.10364.6.camel@sf.rout.dyndns.org> MIME-version: 1.0 X-Mailer: Evolution 2.0.2 Content-type: text/plain Content-transfer-encoding: 7bit References: <9acccfe5041204133432d7a3e@mail.gmail.com> Subject: Re: [gentoo-user] Can a script tell if it's running under X? X-Archives-Salt: 55cf933a-50c0-4957-9517-ceadf9b7ab91 X-Archives-Hash: 320ad2e61fb5657b26537166a90628d6 One way is test if $DISPLAY is set, if it is then you are running in X On Sat, 2004-12-04 at 13:34 -0800, 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 > -- Nick Rout -- gentoo-user@gentoo.org mailing list