Getting Window Properties when your Mouse is Unavailable

Or, floating the menu in xfce

I’m currently using XMonad in Xubuntu, which has been really lovely. However, I got very tired of the xfce4’s menu also being tiled. The XMonad.ManageHook package provides tools for dealing with your windows (floating, ignoring, whatever) provided you have some information about them, like the title.

-- signatures from XMonad.ManageHook

title :: Query String
-- Returns the window title.

doIgnore :: ManageHook
-- Map the window and remove it from the WindowSet.

We can get the window’s title by checking the value of _NET_WM_NAME(UTF8_STRING), which can be done through xprop. But using xprop to get the title of xfce4’s menu by clicking on the open menu doesn’t quite work out

$ xprop
xprop: error: Can't grab the mouse.

We need a way to get information about all the windows we have open. Enter xwininfo!

$ xwininfo -children -root
# lots of stuff here

Unfortunately at this point you have to manually scan the output for what you’re looking for, if you have no idea what it might be called.

At this point we can utilize xprop to get more info about our window, if we choose..

$ xprop -name "Whisker Menu"

…but in this instance there was no need. The following snippet added to your ManageHook, will ignore the xfce4 whisker menu.

title =? "Whisker Menu" --> doIgnore

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s