Trying Out wmii
Wow, I’ve been busy. I just had my math midterm, not to mention the first rehearsal for the play I’m directing.
I did manage to find time on Friday to go on a little adventure, though. Ever since I moved to Linux, I’ve been finding more and more that I like a certain kind of tool. Emacs, for example. It may be complicated and have a steep learning curve, but the power it offers is almost unparalleled.
LaTeX, too. Sure it was kind of a pain to learn, but my math is so beautiful. And it’s so easy to write, now that I (mostly) know how.
I’ll save the rest of my lecture on UI for another post, but suffice it to say that I seem to like tools that have a steep learning curve but are very worth it in terms of power and productivity. Tools that aren’t built for everyone.
I was thinking about this last Friday. And I was thinking about window managers.
I had been using Compiz Fusion for a while, but my computer kept crashing. So I switched back to Metacity, the default, if boring window manager for Gnome.
As I was eliciting pity from a friend who had Compiz working flawlessly, it hit me. Now that I was no longer bound by the golden chain of eye candy, I had a great opportunity to try out a new, interesting window manager.
wmii
I decided to give wmii a go. This was mostly because it was the first thing that came to mind when I thought “interesting window manager.” I think _why uses it, and he seems to be a pretty good judge of what’s interesting.
So what makes for an “interesting” window manager? All I was really looking for was something like what I’d found in Emacs and LaTeX. I wanted a window manager that was powerful, extensible, and usable in that certain hard-to-define seemingly-unusable way.
I also wanted something distinctly different than the previous window managers I’d used. Metacity, Compiz, even whatever the Windows and OSX window managers are called - they’re all based on the same paradigm of “floating boxes that you move and squish.” I wanted something with a totally different paradigm.
wmii certainly fit that bill. It has several interesting features that seem terribly revolutionary to me. Now, I know there are plenty of other window managers out there with similar featuresets. Much of what I find amazing about wmii isn’t actually innovation on the part of the devs (although some of it certainly is). But for me, coming from the insular world of “normal” managers, it’s all mind-blowing.
Dynamic Window Management
One thing wmii shares with some other window managers (although none I’ve used) is that it’s “dynamic.” This means that it actually manages your windows. With Metacity, you have to move all the windows around on your own, resize them, place them just so. wmii does that for you.
When you first start wmii, it just gives you an empty screen with a status bar. As you open applications, it evenly distributes them so that they’re all as wide as the screen and their combined height fills up the entire screen.
You can then pull applications into new columns, so that you might have a stack of three terminals on one half of the screen and one tall Emacs instance on the other. wmii makes sure it’s all organized and sized properly. All you have to do is guide it.
Tagging
A second incredibly cool thing about wmii is that it allows you to tag windows. This is in lieu of a conception of workspaces or minimized applications that other window managers have.
The basic idea is incredibly simple. You can give each window one or more alphanumeric tags. At any given time, you’re displaying all (and only) the windows with a given tag.
Incredibly simple. But also incredibly powerful.
For instance, I like to use tags to divide up my tasks. As I type this, I’m viewing my “blog” tag. I have two apps tagged as “blog:” Emacs for creating the thing, and Firefox for looking up various minutiae and links. Only those two apps are visible right now.
I also have a “hw” tag for doing my math homework. I have Emacs tagged as “hw,” for writing LaTeX, and two Evince windows, one for viewing my compiled LaTeX, and one for viewing the assignment.
Then I have a “prog” tag for programming. This again has Emacs, as well as two terminals. I also have various other tags for various things.
Note that these are all actually the same Emacs instance. It just has three tags, so I can view it in three places. I can even organize it in different ways in the various different views. It could be next to the terminals in “prog” but above Firefox in “blog.”
Scripting
The third really cool thing about wmii is its scripting interface. It’s in the style of Plan 9, a style which I had not previously encountered. It’s based on a concept of files being a metaphor for everything, which is rooted in Unixy stuff like /dev/stdin and sockets and suchlike.
So for wmii, everything is a file or folder.
The virtual filesystem is accessed via the wmiir command,
using wmiir read <filename> or wmiir write <filename>,
which operate on standard input and output,
respectively.
For example, the folder representing the selected window is /client/sel.
To set the tags on that window to “foo” and “bar”,
all you need to do is run
echo "foo+bar" | wmiir write /client/sel/tags
Everything about wmii is accessible through this virtual filesystem. Beats DBus by a longshot.
Installation
Installing wmiir is quite simple.
It’s packaged by Ubuntu, so all I had to do was run sudo apt-get install wmii.
It has a very simple build process, too, though,
so just downloading the source and running make and sudo make install should work for non-Ubuntu folks.
Actually getting it to run is a bit more difficult.
You actually have to (gasp!) edit a file.
Just open up ~/.xsession and add exec wmii to the top.
If you don’t have an xsession file,
just create a new one.
Be sure to add an sh-shebang, #!/bin/sh, at the top.
I’m not sure this is actually important, but better safe than sorry.
Once that’s set up, all you have to do is restart. wmii should start instead of, say, Metacity.
Now, the first thing I noticed when I started up wmii
was that all my Gnome settings – most noticeably, my window theme – were gone.
Luckily, this was easy to fix.
Just run gnome-settings-manager and all should be well.
You can even add gnome-settings-manager & to your .xsession to have it run automatically.
I also wanted to talk about my personal configuration of wmii, but it’s late, I’m tired, and when I’m tired I don’t write well. So I’ll call it quits for now and continue this some other time.
About Me
Feed
More make_resourceful Delays - Sorry!



I use wmii too!
You didn’t know that?
Hrrrm… small world. Wmii rocks my socks for times when I want to productive. I launch gnome when I’m bored and want to be unproductive… which seems to be almost never these days.
Looks interesting. I played with it; one annoyance if you don’t load the full bloat Gnome is that some nice functionality is lost, such as automounting of an external HDD or a camera. [ You guys happen to know what Gnome does automounting? ]
OTOH, I’ll stick with Safwish for the time being—it can do everything you want, you just need to program it (in Lisp^wRep). :)
Found some good hints about Emacs on this website; I’m using Emacs for 8 years now and yet I know so little about it! :) Keep posting!
Try ConTeXt. It’s way better.
Now I’m intrigued, Piotr. Do elaborate.
If you don’t want all the bloat of gnome (gnome-settings-manager), you can also use xfce-mce-manager. It has some nice gtk themes. Thanks for upgrading wmii-ruby, btw. Also, note about .xsession, I always symlink it to .xinitrc. That way if I want to start a second X session I can do
startx -- :1and then use alt-f7 alt-f8 to switch between them. This especially helps when you are testing your wmii scripts.Anonymous: I’m not entirely sure why, but
startxworks fine for me without an .xinitrc.Maybe it depends on the distro or xorg version.
It really is a solid wm. Are the tags persistent across sessions or do you have to redefine the tags every time?
The tags aren’t persistent, but it wouldn’t be hard to add some configuration loading/saving with ruby-wmii.