[SOLVED]Re: how to know if I'm using xterm or gnome-terminal?

Germán A. Racca german.racca at gmail.com
Thu Feb 25 18:17:31 UTC 2010


On Thu, 2010-02-25 at 11:44 -0500, Jake Peavy wrote: 
> On Wed, Feb 24, 2010 at 2:56 PM, Germán A. Racca
> <german.racca at gmail.com> wrote:
>         On Tue, 2010-02-23 at 15:41 -0500, Nalin Dahyabhai wrote:
>         > On Tue, Feb 23, 2010 at 04:52:32PM -0300, Germán A. Racca
>         wrote:
>         > > Hi all:
>         > >
>         > > How to know if I'm using an xterm or a gnome-terminal from
>         command line?
>         > >
>         > > The output of "echo $TERM" is "xterm" from both of them.
>         > >
>         > > How to know?
>         >
>         > James Wilkinson already outlined why most environment
>         variables probably
>         > shouldn't be trusted, so I'll suggest checking the output of
>         >   xprop -id $WINDOWID WM_CLASS
>         >
>         > HTH,
>         >
>         > Nalin
>         
>         
>         Thanks to all that answered my question with a lot of useful
>         suggestions.
>         
>         Finally, I decided to use Nalin's suggestion and implement the
>         following
>         command to know if I'm using an xterm or a gnome-terminal:
>         
>         xprop -id $WINDOWID WM_CLASS | awk '{print $3}' | sed 's/"//g'
>         | sed
>         's/,//g'
>         
>         which returns either "xterm" or "gnome-terminal". 
>         
> 
> 
> for me xprop -id $WINDOWID WM_CLASS returns "WM_CLASS: not found."
> 
> This is on F11, Gnome terminal 2.26.1.
> 
> ?

In my case it is Fedora 12 and gnome-terminal 2.28.2
Germán.

-- 
Germán A. Racca
National Institute for Space Research (INPE)
São José dos Campos - SP - Brasil
http://sites.google.com/site/gracca
http://gracca.wordpress.com



More information about the users mailing list