From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 15639 invoked from network); 4 Dec 2004 21:35:15 +0000 Received: from smtp.gentoo.org (156.56.111.197) by lists.gentoo.org with AES256-SHA encrypted SMTP; 4 Dec 2004 21:35:15 +0000 Received: from lists.gentoo.org ([156.56.111.196] helo=parrot.gentoo.org) by smtp.gentoo.org with esmtp (Exim 4.41) id 1CahYh-0001v5-JH for arch-gentoo-user@lists.gentoo.org; Sat, 04 Dec 2004 21:35:15 +0000 Received: (qmail 26384 invoked by uid 89); 4 Dec 2004 21:35:00 +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 13715 invoked from network); 4 Dec 2004 21:35:00 +0000 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:reply-to:to:subject:mime-version:content-type:content-transfer-encoding; b=kHC8s0ldZAZYxwxwtwguDux9OiDvtSkiI0VOOdsDGLC4xOZt/nrJsxzWkt/iNVziqJRcmEYgL0zLPTVOegbP4P6HQtMy47St+N1e2hvvvd6uywaM7QXgCbrRyeuTIPrp3B10pZBQsGX9YDpiKOYNH252Wrj2LrdLPfvWMVPP3+E= Message-ID: <9acccfe5041204133432d7a3e@mail.gmail.com> Date: Sat, 4 Dec 2004 13:34:58 -0800 From: Kevin O'Gorman Reply-To: Kevin O'Gorman To: gentoo-user@lists.gentoo.org Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Subject: [gentoo-user] Can a script tell if it's running under X? X-Archives-Salt: 1f7623f4-8540-4bc1-854b-16a4051f46af X-Archives-Hash: 09c091194b36019b366742197f35e515 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 -- Go back to the top: I almost always top-post Kevin O'Gorman, PhD -- gentoo-user@gentoo.org mailing list