Today I started a new project on github that aims to bring the same level of freedom in setting up key bindings that Xmonad and FVWM provides. The project uses python-wnck and python-keybinder, and coexists with the window manager.

Configuration example:

import gtk
from wmbinder.commands import *

if __name__ == '__main__':
    bind("<Mod5>z"      , spawn , "xclip -selection primary -o | xclip -selection clipboard -i")
    bind("<Mod5>x"      , spawn , "xterm")
    bind("<Mod5>t"      , focus , "Firefox"      , cmd="firefox")
    bind("<Mod5>Return" , focus , "XTerm"        , cmd="xterm")
    bind("<Mod5>s"      , focus , "File Manager" , cmd="nautilus ~")
    bind("<Mod5>v"      , focus , "Vim"          , cmd="gvim --servername VIM")
    bind("<Mod5>n"      , nextWindow)
    bind("<Mod5>e"      , prevWindow)
    bind("<Mod5>k"      , close)


I have imported the old post for now, and will update the rest of the site when I get time. Thank you for your understanding…

— Mads


In addition to Vim, I use Emacs for things like org-mode and certain functional programming languages. Of course, I have configured it to behave closely like my Vim setup. The keybinding layout works fine using both Qwerty and Colemak (if you swap Y and J).

Configuration highlights:

  • Viper
  • Tabbar
  • Org-mode

The files are available at my Github repo.

Check out my dotfiles repository at:

I think it’s about time I post my updated XMonad configuration. This version does not require any patches, at XMonad 0.9 supports modular configurations natively.

New highlights:

  • The application pager now uses icons
  • Per application configuration.
  • Minimize windows by using special workspaces

Note that I have converted my Colemak key bindings to Qwerty to give an idea of the placement I use. Also note that this work is not finished. There are still lot of things I want to behave differently, and I need to do some cleanup here and there.

Still, I hope you can get inspired by some of my ideas. Enjoy 🙂

Using Keyconfig

If you use many web applications like GMail and Remember the Milk, you may want to get access to them using a single key binding. In Firefox you can use the following snippet together with the Keyconfig extension to

  • cycle between all tabs matching the regular expression re
  • if no tab matches, open a new tab showing url
function openOrCycle(url, re) {
    var wm = Components.classes[";1"]
    var browserEnumerator = wm.getEnumerator("navigator:browser");

    // Check each browser instance for our URL
    var found = false;
    while (!found && browserEnumerator.hasMoreElements()) {
        var browserWin = browserEnumerator.getNext();
        var tabbrowser = browserWin.gBrowser;

 continue reading...

Many sites (for instance sends binary files using the application/octet-stream mime type. This is annoying for Firefox users, as they presented with a dialog asking Would you like to save this file? instead of showing the standard dialog offering both the options Open with and Save file.

Bug 327323 has a patch that uses gvfs to determine the mime type from the extension if Firefox cannot determine it itself. However, if you can’t wait for that fix to reach your distributions package repository, here is a patch for Firefox 3.5 that bypasses the security restriction for octet-streams and executables. Note that it won’t remember the application you specify to handle the file, but your can circumvent that by using the OpenDownload add-on, which uses your native mime system to look up the default application.

Edit: I found out that OpenDownload also alters the security restricted download dialog, so you can suffice to install OpenDownload if you want to avoid patching Firefox. You will only be able to open the file with your OS’ default handler, though.

GMail has a nice keyboard accelerated web interface making it competitive to desktop mail clients as Thunderbird and even Mutt. One reason I stayed with Mutt for a long time was the ability to integrate with Vim. I switched to GMail’s web interface for other reasons, but nevertheless it was delightful to discover ItsAllText; a Firefox add-on that allows you to edit any textarea in an external editor. continue reading…

As you can see I have polished my blog a little, and added a very important feature: A blog focusing this much on key bindings must naturally have keybindings. Using this plugin, you can now zap back and forth between posts by pressing Shift-Left and Shift-Right – useful huh? 🙂

By the way, see Vito Chin’s article about Keyboard Enabling Web Applications.

Wouldn’t it be nice if you could navigate through your application’s menus using vi-like bindings? You can! Simply something like this in your ~/.gtkrc-2.0 file:

binding "gtk-binding-menu" {
    bind "j" { "move-current" (next) }
    bind "k" { "move-current" (prev) }
    bind "h" { "move-current" (parent) }
    bind "l" { "move-current" (child) }
class "GtkMenuShell" binding "gtk-binding-menu"

Keybindings for other GTK widgets can be defined in a similar way. What about moving focus between widgets in the direction they appear? continue reading…