Tag Archives: gwbn

gwbn – goto window by name in Linux

Years ago when I was using the Ion window manager.  Ion had many very nice features, not the least of which was goto window by name, which you could do from an interactive console or script into other tools.  I created an “e” command, which loaded the file in emacs, then moved you to the emacs desktop window.  This was a great minor productivity boost.

Ion went off the rails for me in a number of ways, so I left, and started using stock gnome in ubuntu.  Using a combination of tilda, superswitcher, and devilspie you can get very close to the functionality that I missed, with the added benefits of all the modern bits of the gnome desktop, like dbus, nautilus, and hardware just working and doing the right thing when you plug it in.  But I never got goto window by name back.  I played with libwnck for a while 2 years ago, and never could figure out what I was doing wrong.

Yesterday, with an hour of idle time in the morning waiting for people to get back to me, I decided to look at the problem again.  This time I started with the libwnck perl bindings, because getting rid of the compile time meant I could experiment a lot more in less time.  After about 20 minutes of guessing on the API I figured out what I had probably missed before, the screen object needs a second stage initialization.  After 20 minutes more, I had gwbn, a perl program that took a regex on the command line and moved my desktop to the first window that matched.

The code is available on github now, and probably on cpan or a ppa for ubuntu before too long.  Now I have my “e” command again, and am a very happy camper.