..in which I propose a potentially-new window management feature, and hope that somebody has already done it so that I won’t have to…

I’m currently developing file-finder, a simple tool to quickly find files by name (beneath a given directory). It’s like the “jump to file” feature in most IDEs, but it’s a simple, standalone tool that can be used with any editor (and it beats the pants off most of them in terms of speed). I chose to write it as a terminal app, because that way it can run as a companion to any editor - and it certainly doesn’t need anything that curses doesn’t offer. The trouble is, it needs to run in its own distinct window - ignoring any fancy terminal-embedding hacks (which aren’t possible in vim, my editor of choice lately). I’d quite like to have it as sort of a sidebar for whatever editor I’m using, and I wonder if the window manager can help here.

Many window managers have window snapping, whereby if you move a window close to the edge of another, it’ll “snap” into position right next to it. I have never really seen this as useful, since it is a very one-off sort of operation. You move a window into place, and then you’re on your own.

What I’d love to see is a window manager that remembers what windows you have snapped together, and make use of this information to intelligently move or resize windows. To illustrate:

fig. 1: Standard “floating” windows

Here we have 3 windows, arranged arbitrarily. This is the normal mode of operation - every window is independent.

fig. 2: Snapped windows

Here, the the green window has been moved next to the red. As a result it “snaps” onto the side of it. The green window’s height is extended to the height of the red, and they form a single rectangular region for all future resize and move operations - that is, making the red window taller will also make the green window taller, and moving the red window will move the green window by the same amount.

In addition, the border between them will now act as a slider - when the green window’s right-hard border is expanded to the right, the red window’s left border should move the same amount right to keep the edges together.

In order to detatch windows, there are a few options:

  1. Moving / resizing the biggest window in a region moves the whole region, while moving a smaller window detatches it from the others
  2. Moving / resizing any window acts on the entire region, except for when a keyboard shortcut (e.g. shift) is held down.

I would prefer option (2), because it’s less to remember (and I think easier on my muscle memory). But it would be much less discoverable.

So, dear readers: I ask you. Does such a thing exist, or will I have to roll my own? I currently use metacity, but I could be convinced to change. I could also be convinced to write a compiz plugin, if such things are possible to do in a plugin. Does anyone have any leads? Is it a good idea?

*: Of course, I wouldn’t have this trouble if I used a tiling window manager. But for the most part I do prefer free-form windows, so that wouldn’t suit me too well (I’ve tried). screen is another convenient option for embedding tiled window sets within free-form windows, but it restricts me to a terminal-only editor (this is not ideal).