Sunday, November 2, 2008

Making your own programs float in awesome window manager

I do a fair bit of graphics/game coding in my spare time (and occasionally for classes). These don't fit well into tiling environments, since I usually want them to be a specific resolution, and in-front of all other windows. Fortunately, there's an easy way to do this with the awesome window manager (note: this is with version 2.3).

The normal way of making things float in awesome is like this:

rule { name = "Gimp" float = true }


However, this didn't work so well for my stuff. I tried variations of a.out (which I swore I got to work before...wish I'd backed up that conf file...) to no avail. However, you can also use xproperties, obtainable from xprop (run xprop in a terminal, click on the window you want info for, and the x properties will be printed in the terminal).

For my current project, this gave me:

$ xprop
WM_STATE(WM_STATE):
window state: Normal
icon window: 0x0
_AWESOME_PROPERTIES(STRING) = "0010000000"
WM_PROTOCOLS(ATOM): protocols WM_DELETE_WINDOW
WM_LOCALE_NAME(STRING) = "C"
WM_HINTS(WM_HINTS):
Initial state is Normal State.
WM_NORMAL_HINTS(WM_SIZE_HINTS):
user specified location: 100, 100
user specified size: 800 by 600
WM_CLIENT_MACHINE(STRING) = "Gecko"
WM_ICON_NAME(STRING) = "Asteroid Game"
WM_NAME(STRING) = "Asteroid Game"


In the rules section of ~/.awesomerc, I added the following:

rule {xproperty_name = "WM_NAME" xproperty_value="Asteroid Game" float = true }


It worked! (A bit tedious to add for each new app you work on, but better than nothing for now....I'll update post if I figure out how my old a.out trick worked).

No comments: