I’ve used Linux for years, but over the past few months I’ve fallen in love with tiling window managers in general, and wmii in particular. wmii is a manual tiling window manager (like i3, ratpoison, or stumpwm, and unlike awesome or xmonad), meaning that windows stack on top of each other by default, and the user creates extra “panes” for tiled windows as needed.
I find wmii better than most of its competition for 3 reasons:
- Unlike a lot of other tiling window managers (with the notable exception of i3), it has actual window titlebars. This means that stacked windows remove the need for a taskbar completely, while still allowing windows to be “minimized.”
- Its style of manual tiling is very simple: instead of nested frames that can be split in any direction, it only has columns, and each column may be either stacked, split, or maximized. Though this is limiting at times, it prevents getting lost in a sea of confusing nested frames, which was often my experience with i3 and stumpwm.
- This is the most interesting one: you are able to (and somewhat expected to) write a large portion of the window manager yourself. The wmiirc script file handles all event processing and user interaction, and, although a basic one is provided, you can only do really cool things with wmii by writing your own. This is somewhat like the built-in scripting languages of awesome or xmonad, except that it’s not tied to a single language and it has a very simple API consisting of a pseudo-filesystem accessed through the wmiir command.
The cool thing about wmii is that its configuration script is event-driven, but those “events” consist of lines being written to a file (not a real file; wmii uses a virtual filesystem based on concepts from Plan 9), which then show up immediately to any programs that are reading from that file. Any number of running programs can be sending and receiving events on this messagebus, just by running the executable wmiir. They can then modify windows, the wmii bar, and wmii settings by using wmiir to write to other virtual files.
Soon after starting to use wmii, I became irritated with the defaults and decided to write my own wmiirc setup–in bash. The default wmiirc is written in bash, so how hard can it be, right? I ended up writing a fairly complex set of modular bash scripts and configuration files (parsed by awk), which is available on my GitHub. The problem is, it ended up being very slow and buggy, and I couldn’t restart it or modify details (like the bar widgets) without “leaking” forked processes. The code was becoming a mess, and I needed an alternative.
And that gave me an idea.
And I’ll document the whole process in this blog.
Next post: Event Handling >>