GNOME bug 97725 raises the interesting idea of associating keys with windows. Two differing approaches have been advocated:
- Have a set of keys which work to “bookmark” windows, and a corresponding set of keys which mean “jump to bookmark n“.
- Have a keystroke which means “bookmark this window using the key I’m about to press”, and allow users to press bookmark keystrokes in the alt+tab window.
It is of course important that the bookmarks are associated with a given window indefinitely, otherwise they become a lot less useful.
As a step towards the second option, I’ve written a very quick and hacky script called metacity-bookmark. The name is a little misleading, because it should work with any EWMH window manager; it uses the window matching technique described in this post. As usual, you’ll need X11::Protocol installed from CPAN (“sudo cpan X11::Protocol“).
Bind the program to some key or other, which we’ll call Bookmark from now on, and then you can do:
- Bookmark + key — jump to the window identified by key
- Bookmark + Space + key — identify the current window by key
Feel free to play with this and let me know what you think. I’ve made little windows pop up to tell you the program was running, inspired by the “Compose” indicator that used to appear onscreen on old DECs, if my memory serves.
One obvious limitation of the current script is that when it activates a window, it doesn’t switch to the workspace which the window’s on. I may fix this another day when I fix all the other problems with this script, but if you fancy diving in and fixing it yourself, it shouldn’t be too hard.
As a possible extension to this, windows could also have bookmarks automatically associated with them from their creation, based on their name– for example, the first GIMP window could automatically be given “G”. And either kind of bookmark could be displayed in the Alt+Tab switcher next to the associated window’s preview or icon.
Photo © jpre86, cc-by-nc-nd.