spawn a web browser with a hotkey in Awesome

As I'm getting the hang of Awesome's config file and Lua, I'm finding it to be really powerful. Yesterday I added a volume control widget, and today I'm doing something I've been meaning to do for a while - adding a hotkey for opening a browser.

To do this you need to find the key bindings section in rc.lua. I wanted to have mod key + w open Chromium. This is similiar to something I found really handy in Crunchbang. By default, mod key + w opens another Awesome menu at the cursor, which is something I haven't used once and can't imagine using, so I replaced that.

So in the callback function where it had said

mymainmenu:show({keygrabber=true})

I replaced with

awful.util.spawn("chromium-browser")

and restarted Awesome with mod + shift + r.

And voila, mod key and w spawns a Chromium.