Awesome window manager

  • updated 2013/10/01 to add missing bitmaps and a missing link: the original version was deployed by accident

I am writing this blog post on a 6 year old laptop. When I bought it in 2006, its specs were great, or at least I thought so: AMD Mobile Turion 64 processor, 2 GB of RAM, 80 Gb HDD and an NVidia Geforce Go 6200 graphics card with 256 MB on board. However time has passed and it is definitely not the fastest tool in the shed anymore. Its specs still seemed good enough for my purposes and I decided to spent some time on getting it up to speed again.

To cut a long story short, I brought this quest to a successful end but only because my free time does not cost money. I enjoyed the journey and it is the journey that counts.

The family laptop, which is a few years less ancient, is running Ubuntu 12.04 with Unity 3D and I like it very much. I also installed that combination on the old workhorse but that proved to be too much: Unity 3D did not even run and Unity 2D was sluggish. The previous time I had to use older hardware I settled for the more lightweight desktop environment (DE) XFCE. At the time I quite liked it so I decided to use it again.

The XFCE spin of Ubuntu, named Xubuntu, worked a lot better. But from time to time it still was a bit sluggish. A real annoyance was that applications I defined to run at startup sometimes did not run or ran too early and there effects were discarded. For example, one of my startup applications was the command to make my Caps Lock a Crtl key and to set my Compose key:

setxkbmap -option compose:rctrl -option ctrl:nocaps

More often that not I had to rerun that statement after login. The same was true for the xrandr statement that sets my second monitor correctly.

The biggest issue was the delay after I had logged in: after login, it could take a minute before the desktop was shown. By the way, it turned out that that delay was not caused by XFCE :) but more about that later.

The hardware was not the only reason to look for another desktop environment. At work I also use Xubuntu and in that setup I often have multiple terminal windows open. It can be a bit of a hassle to manually layout these (and other) windows on my desktop. I knew that there were window managers that could do that automatically for me and this brought me to Awesome.

Awesome is a so-called tiling window manager. A tiling window manager places and sizes the application windows in such a way on your desktop that optimal use is made of the available screen real estate. When you tile the application windows, they partition the visible desktop. Each time you open an additional window, the window manager automatically moves and resizes one or more of the already visible windows to make room for the new one. The following screenshot shows you an Awesome window placement scheme or layout, with a single master column for the most interesting window and a client column for the other windows:

/images/vertical-layout.png

The second screenshot shows a similar layout, but this time with a single master row and a client row:

/images/horizontal-layout.png

There exist layouts in Awesome that do not tile. I often use the maximize layout, which lets the window that has the focus fill the desktop. This page on the Awesome wiki lists the available layouts.

Awesome itself is configured using a file written in (the programming language) Lua. In this file you define key bindings, your color theme, applications that have to run at startup, virtual desktops (or "tags" as they are named in Awesome) etc. The configurations that come with Awesome are self-explanatory so you do not need in-depth knowledge of Lua to customize them.

/images/awesome-background.png

The screenshot above shows my current desktop. It is based on the Zenburn theme which is part of the Ubuntu package 'awesome'. I have made some relatively minor changes to that configuration:

  • add the XFCE application finder to the Awesome menu;
  • bind Alt-F2 to launch the application runner gmrun;
  • rebind several keys with regard to window navigation and placement;
  • use a custom desktop background with the Awesome key and mouse bindings.

You can find the complete complete configuration in my awesome Bitbucket repo. If the background seems familiar, that is correct. It is based on an image that comes with Ubuntu Unity that shows its key and mouse bindings. As Awesome comes with a lot of key bindings, which I still have not memorized, I tracked down the SVG of the Ubuntu Unity image and adapted that to Awesome. You can find both the SVG and a 1920x1080 rendition of it in my repo.

Awesome is a window manager and I quickly found a window manager is not the same as a desktop environment (DE). For example, XFCE implements the functionality to modify the appearance of your desktop, start the screensaver, automount USB devices, shutdown your workstation as an ordinary user. So the first time I ran Awesome, I was looking at large fonts and ugly widgets instead of the finely-tuned appearance I defined in XFCE. The easiest way to resolve that was by (automatically) starting xfsettings after login. The fonts of the Qt application however remained large and ugly. To get them to show the right fonts I had to set the Fontconfig configuration [1]. The README of the Bitbucket repo explains all this and more.

As already mentioned, my personal configuration makes use of XFCE. So if you want to reuse that configuration and your desktop environment is not XFCE, it will not work for you. Probably you just have to make a few minor changes to get it to work with another desktop environment or without any at all.

I want to close it off with the following. Earlier I mentioned the delay that occurred after I had logged in to XFCE. Unfortunately this delay occurred even when I used Awesome... It turned out that this is not a problem with XFCE but one with LightDM, the login manager Xubuntu uses, and 64-bit machines, see bug #996791 on Launchpad :).

Have fun with it!

[1] Visit https://wiki.archlinux.org/index.php/Font_Configuration for an excellent explanation.

Comments

Comments powered by Disqus