Tuesday, June 05, 2007

New computer + Ubuntu + Beryl = Wow!

I haven't had a functional desktop machine for years -- I've been living a nomadic computing existence between my laptops, with the occasional attempt to build a frankenputer out of spare parts I have lying around. Well, I finally caved.

The cheapest Intel Core 2 Duo available, a nice, reliable motherboard, 2Gb of RAM, a few (relatively safe to use) spare parts, and I've got a brand spankin' new system for just over $400. Ubuntu really pushes the envelope for "it just bloody works" operating systems, and I'd say it was even easier to install than Windows XP (though not *quite* as easy as OS X).

The setup did get a little more complicated once I wanted to use some of the more experimental/development features of the OS. In particular, I've been itching to use Beryl, the current best open source answer to QwartzExtreme or Aero. I am completely blown away -- the software is still very young, and miles away from a 1.0 release, but very usable and totally gorgeous. You really have to see it in action to believe it, screenshots do it no justice.

I did have a bit of an adventure trying to reconfigure a few key bindings. I wanted to configure the alt-tab window switching so that alt-tilde switched windows in reverse order, much like under Windows or OS X. The key binding configuration was slightly non-user-friendly, unfortunately. Instead of pressing the key combination you wished to bind, you had to type in a string representation of the same sequence. For most combinations, it was plenty obvious -- with a page full of examples, simple pattern matching would get whatever you wanted. The tilde key, however, proved to be more elusive.

Simply trying "Tilde", "tilde", "twiddle", and "`" didn't work. So, before throwing in the towel, I did what any good Linux geek would do -- I started looking for source code. Thanks to Google Code Search, I didn't even have to download the Beryl source to start searching through it. Very sexy.

After a bit of code browsing, I found that the text input was being converted to a key identifier via a function named "XStringToKeysym". That was a different naming convention than the rest of the Beryl functions, so I figured it was from an external library. In fact, it's a standard Xlib call (I think), and all of the "keysym"s are defined (and named!) in a standard X11 header file -- which I already had installed. Searching that file for anything like tilde, I finally figured it out. The name is (case sensitivity matters!), "asciitilde". Hardly consistent with names like "Tab", but I figured it out, it didn't take me very long, and now I've got the keybindings I want.

Score +1 for the benefits of open source, -1 for poor usability, +1 hojillion for looking and feeling fantastic once it's been set up.

On a side note, I compiled my (work) code on this machine to test it out, and it already runs twice as fast as it does on our cluster using the same compiler -- and the clock speed is technically the same. I <3 C2D.

1 comment:

Zifnab said...

*deep voice* Beryl!