awesome revelation


I enjoy blogging about Python, but sometimes it’s nice to branch out a bit

Recently, after getting a bit fed up with compiz and Unity, I decided to try out a tiling window manager, and I decided to start with Awesome.

I’m new to lua, and Awesome is one of those tools whose philosophy is something like “all code, no config.” As a result, Awesome is configured by writing lua code that runs within the WM.

While there is a steeper barrier to entry, the result seems to be a very flexible and extensible window manager.

It also gives me the opportunity to learn more about Lua, of which I previously knew very little. I still know very little about Lua, and the only thing I know about the language is what I’ve been able to piece together from reading the Awesome WM source code and reading sample rc.lua configuration files.

It seems like a very neat language, and I was impressed by the simplicity of the interpreter. It eschews the use of autoconf or automake in lieu of a simple, handwritten makefile no longer than 115 lines in length. From this makefile, however, it’s able to compile for 10 different platforms!

# Convenience platforms targets.
PLATS= aix ansi bsd freebsd generic linux macosx mingw posix solaris

Now, before I became familiar with the keyboard shortcuts for manipulating tags, I wanted the ability to see the contents of multiple tags at once, which is where the Revelation plugin steps in.

However, certain windows don’t respond to window manager hints and resize when in Exposé mode, so I decided to add a zoom function. Compiz’s Scale plugin binds this to the right mouse button. When you click on a window, you temporarily see it scaled to full screen, and when you release the right mouse button, you return to the Exposé view.

I implemented (hacked this together) in an hour: added zoom mode

Please, don’t use this code.

I found this code helpful (though these days, I more typically use some custom tag-shortcuts I wrote.)

I am not a Lua expert; I’ve never read a Lua book or a Lua tutorial; and the only Lua I know is hacked together from playing with Awesome.