Gentoo Logo
Gentoo Spaceship




Note: Due to technical difficulties, the Archives are currently not up to date. GMANE provides an alternative service for most mailing lists.
c.f. bug 424647
List Archive: gentoo-user
Navigation:
Lists: gentoo-user: < Prev By Thread Next > < Prev By Date Next >
Headers:
To: gentoo-user@g.o
From: Bastian Balthazar Bux <BastianBalthazarBux@...>
Subject: Re: Can a script tell if it's running under X?
Date: Sun, 05 Dec 2004 01:55:43 +0100
Matan Peled wrote:

> 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.).

dangerous, if you login via telnet or ssh it's a choiche of the client 
and thae coise is pretty large

--
gentoo-user@g.o mailing list

References:
Can a script tell if it's running under X?
-- Kevin O'Gorman
Re: Can a script tell if it's running under X?
-- Matan Peled
Navigation:
Lists: gentoo-user: < Prev By Thread Next > < Prev By Date Next >
Previous by thread:
Re: Can a script tell if it's running under X?
Next by thread:
Re: Can a script tell if it's running under X?
Previous by date:
Re: Local portage repository
Next by date:
Re: Gcc and Libc Problems


Updated May 04, 2012

Summary: Archive of the gentoo-user mailing list.

Donate to support our development efforts.

Copyright 2001-2013 Gentoo Foundation, Inc. Questions, Comments? Contact us.