Main Contents

Who are you? : Finding out WM_NAME in Linux

January 5, 2008

Problem:

I’ve been using Ubuntu in quite a while. I missed the windows tiling capability that is available in Windoze OS. This doesn’t come easy in Ubuntu. You would have to download a deb package from http://freshmeat.net/projects/wmtile/ or http://ostatic.com/wmtile and install tile into your system. It’s a command line tool that allows tilling of all unmaximized and unminimized X windows either vertically or horizontally. A simple command used in Ubuntu would be similar to this:

tile -w

Just create a launcher somewhere that is easily accessible and you’re good to go.

Not quite yet! This doesn’t work well in Ubuntu with the default X window manager, Metacity, yet. It keeps on tilling all the wrong X windows. Even the panel is being tiled.

In Ubuntu tile stores its settings in two files found in /usr/share/tile/. The “rc” file would be the one important for our discussion. This file stores the X windows to be avoided by the tile program. To exclude certain X window, include codes similar to this:

avoid WM_NAME Bottom Panel
avoid WM_NAME Desktop
avoid WM_NAME gkrellm
avoid WM_NAME gbuffy
avoid WM_CLASS FrontPanel

However, I have no idea how to get this informations. I hated this as tile command messes up my desktop. It moves around my top panel and Avant Window Navigator which is a huge deal cause this renders the tile command useless.

Solution:

After plunging into the net for about two days I finally got what I’ve been looking for, a way to get WM_NAME and/or WM_CLASS. Just run the following code into your terminal:

xprop | grep -E “^(WM_NAME)|(WM_WINDOW_ROLE)|(WM_CLASS)”

Your cursor would change into a cross hair. Click on any window/object on your screen and voila! You’ll be able to see WM_NAME and/or WM_CLASS on your terminal. I got the following for my top panel and Avant Window Navigator:

avoid WM_NAME Top Expanded Edge Panel
avoid WM_NAME avant-window-navigator
avoid WM_NAME awn_elements

Screenshots:

TIle (Gnome, Metacity with Avant-Window-Navigator)

Filed under: Ubuntu | Comments (0)
Related Links:

Leave a comment