In this chapter you will learn how wmii was designed, which ideas the wmii developers followed and how it was implemented.
wmii was designed around the new idea of dynamic window management. Dynamic window management means, that the window manager should make all decisions about window arrangement, thus taking most extra work away from the user and letting him concentrate on his work. This can also be seen as tacit window management.
The developers of wmii know about the most powerful ideas of Unix. One of them is the idea to use distinct tools for distinct tasks. By carefully designing the window manager, they were able to split the task into several smaller binaries, each with a distinct job.
Programs in the Unix world usually communicate via buffers which are addressed by (file) descriptors, one of them are sockets.
To create a lightweight but powerful communication protocol, the wmii developers closely looked at the design of Plan9 and chose the 9P protocol.
The basic ideas for configuring and running wmii were taken from the Acme user interface for programmers of Plan9. Similar to Acme, wmii provides a filesystem-interface, which can be accessed by 9P clients. This allows to interact with any different kind of application through a file system interface, which might be implemented in any programming language of choice. This also avoids to force client programmers to a specific programming language or paradigm.
The interface of wmii can be compared to the procfs file system of the Linux kernel.
If you want to interact with a running wmii process, you can access its 9P file-system service through either using the bundled tool wmiir or the 9P2000 kernel module of a Linux kernel later than 2.4.16+. Using the kernel module has the advantage to mount the filesystem of wmii into your file system hierarchy directly, though it has the drawback that this need root privileges.
This section provides a basic overview about the tools which are bundled with wmii. But for a more detailed description, you should read the associated man page of the specific tool.
wmiir needs to know the address of the file-system service to work
with. On startup, wmii exports the WMII_ADDRESS environment variable,
which points to the address of the file-system service of wmii.
This address can be:
unix!/path/to/socket
tcp!hostname:port
If you want to work on a different filesystem, you may specify it manually with the -a address command line option. A sample invocation looks like:
wmiir read /
This command actually prints the contents of the root directory of the
virtual file-system of wmii.
The virtual file-system service of wmii and the tools presented enable you to fully control the window manager from scripts. You will see some examples in the next section 6.