Foo Window Manager

Minimal IPC/DSL-based Zooming Wm

Foo Wm was an idealistic & minimalistic wm for X11 which I built over the course of a summer while doing Hacker School. The architecture of the wm was simple, involving only two components:

  • A tree data structure to hold windows and
  • A DSL to manipulate & traverse the window tree

In foo-wm 'tiling' and 'floating' modals of organization familiar in WIMP were just setting values of containers. 'Workspaces' were just the immediate containers of the root node. And 'full-screening' a window meant simply issuing a zoom DSL command with a high positive delta.

Screenshot of Foo-Wm Me at work, using foo-wm to edit foo-wm's code.
Representation of Foo-wm nodes Workspace's didn't exist within foo-wm, because given the tree structure they were easily emulated using the zoom command.

The Foo DSL, accessible via a socket, was the only way to interact with foo-wm itself. In fact, foo-wm didn't even provide a way to bind keys to wm actions, because xbindkeys could and still can do that anyway.

All commands in the Foo DSL operated on two pointer nodes within the tree. The active node controlled the node currently through-putting mouse and keyboard events; and the view node represented the node that the screen was currently displaying. The full DSL was as follows:

Command Targets Node Purpose
zoom view node Zooms screen through tree.
containerize focus node Wraps current node in a new parent node.
focus focus node Moves focus pointer to brother in focus node's parent.
shift focus node Moves focus node's parent position relative to its parent.
kill focus node Removes focus node window from tree.
mark view node Sets a bookmark on the current viewnode.
jump view node Restores a bookmark of viewnode set with mark.

After building foo-wm I used it for about a year on and off. Being my first major serious C project; I learned to about malloc, free, and memset the hard way -- watching my windows crash and burn.

I've since stopped using foo-wm because I was too lazy to implement full EWMH window hinting, which substantially limited the number of applications I could use within foo-wm without annoyance.

When I go to build my next wm I'll likely scrap foo-wm and take a completely different approach1 to a meta-wm/DSL-based-wm altogether.

While Foo Wm may be dead, it spirit lives on in some form. The 0.1 release of Bspwm, a popular tree-based wm within the Arch community, was based around the server/client architecture that I built into foo-wm2.

  1. no-wm is an amazing proof-of-concept.
  2. Bastein stated on the herbluftwm mailing list that Bspwm's server/client IPC skeleton was originally extracted from foo-wm! Although, Bspwm has evolved much since then, it's nice to know foo-wm served as an inspiration.