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

Jake Peavy djstunks at gmail.com
Thu Feb 25 16:44:16 UTC 2010


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.

?

-- 
-jp

It's funny how annoyed people get when you carry a bullhorn around all the
time, even if you don't use it that often.

deepthoughtsbyjackhandey.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.fedoraproject.org/pipermail/users/attachments/20100225/3b9824bf/attachment-0001.html 


More information about the users mailing list