next up previous contents
Next: 6 Scripting wmii Up: A Guide to wmii-31 Previous: 4 Getting started   Contents

Subsections

5 Looking under the hood

In this chapter you will learn how wmii was designed, which ideas the wmii developers followed and how it was implemented.

5.1 Dynamic window management

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.

5.2 Modularity--using distinct tools for distinct tasks

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.

5.3 The glue that puts it all together--9P

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.

5.4 Tools

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 is a small tool we is used to access the virtual file-system service of wmii remotely. It basically supports four operations:

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:

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.

wmiimenu is a generic keyboard-driven menu, which matches items through providing patterns. You may want to learn more about it by reading the man-page.

wmiiwarp is a tiny tool to warp the mouse pointer at specific coordinates on your screen.

wmiiwm is the main window manager binary. You may interact with its virtual file-system only.

wmiipsel prints the contents of the current X selection to STDOUT. This is useful for scripts.

5.5 Conclusion

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.


next up previous contents
Next: 6 Scripting wmii Up: A Guide to wmii-31 Previous: 4 Getting started   Contents

Last update: Sun May 7 19:58:06 GMT 2006 by salva@firulillo