[openbox] SwapGeometry (proposal)

Carlos Pita carlosjosepita at gmail.com
Mon May 5 12:57:05 EDT 2014

Hi all,

I tend to use Grow/Shrink/MoveToEdge actions a lot to get some
pseudo-tiling inside openbox, coupled with MoveResizeTo and some
preset geometries I use the most. But then I would like to be able to
restore some "normal" geometry after "tiling" a bit, because what I
always hated of tilers is how they force some layout oriented to see N
things at the same time (I'm admittedly already at grips with N=2)
when it's not the use case at hand. Ranting aside, I would like to
restore some "normal" geometry after the resize excursion, as I've
already said.

So I came up with a simple swapgeom python+xpybutils script (which
could also have been implemented using an appropriate combination of
xprop, xdotool and wmctrl, I guess) that saves the geometry of the
currently focused client and restores the previously saved geometry,
if any. The typical use case for me is to save the initial geometry of
a window and then think of it as the normal mode and of the
alternative geometry as the tiled mode. Then I move-resize the client
to the contents of my heart when in tiled mode, knowing that I've
backed up the preferred geometry for the time when stacking comes

This swapgeom thing (attached), as it's currently implemented, relies
a lot on ewmh/netwm and, since it must detect the maximized state of a
client and return it to unmaximized before saving the geometry, there
is some unpleasant visible sequence of window manager actions while
the swap takes place (unmaximize, save geometry, restore previous
geometry, retore previous maximized state).

So I would like to implement it as an action, say SwapGeometry, which
will work on the currently client simply saving some structured data
like { prev_x, prev_y, prev_w, prev_h, prev_maxh, prev_maxv } and
restoring the previously saved one, if any.

Do you think this could be of general enough interest to be included
as part of openbox? I think it's a nice complement to the
pseudo-tiling support openbox already has. The dynamism these
Grow/Shrink/MoveToEdge and MoveResizeTo actions offer feels a bit
crippled when there is no way to switch back and forth between some
geometries. As it stands my solution is pretty simple, I deliberately
avoided keeping a history of geometries or backing up entire desktop
layouts. Instead, it's more of a Undo/Redo toggle. But I would like to
hear some opinions from you.

Best regards
-------------- next part --------------
A non-text attachment was scrubbed...
Name: swapgeom
Type: application/octet-stream
Size: 1677 bytes
Desc: not available
URL: <http://icculus.org/pipermail/openbox/attachments/20140505/4ef28a24/attachment.obj>

More information about the openbox mailing list