wmjump - keyboard navigation of the desktop; use the keyboard to switch between windows and workspaces
wmjump [OPTION]
wmjump pops up a dialog box with a list of running windows in their historical order, and a letter next to each item. Pressing the corresponding key brings you to that window. Pressing the number key 1 to 9 brings you to the corresponding workspace.
If you use Compiz (which is the default window manager on recent Ubuntu distributions), then use the Compiz compatibility mode:
wmjump --compiz
In Compiz the workspaces are arranged into a grid, so each workspace has a pair of ``coordinates'' x,y. To switch to a given workspace in a --compiz mode, press two number keys. For example, if you need to switch to the desktop with coordinates x,y=1,3 you have to first press 1 and then press 3. (The switching works for the grid of up to 9x9 workspaces.)
I recommend creating a keyboard shortcut for wmjump (or wmjump --compiz ). In Xfce, go to Settings -> Settings Manager -> Keyboard -> Keyboard Shortcuts. In gnome, google for: gnome custom keyboard shortcut. I use <Alt>-k after Ion3. Also see OPTIONS.
The items are colored according to the window class. The assignment of colors can be changed in the configuration files, as described below. I recommend having the Industrial gtk engine installed, because it looks nice with the multicolored buttons. (It is probably installed by default in Ubuntu.) It is not necessary to make it a default gtk engine, only wmjump will use it.
wmjump is supposed to work on all EWMH/NetWM compatible window managers. I tested it on Xfce (Xubuntu), gnome Metacity (Ubuntu, Fedora), gnome Compiz (see OPTION --compiz), Kwin (Kubuntu) and StumpWM (v0.9.5 on Intrepid, see special instructions for StumpWM in the SETUP section).
The following option modifies the behaviour of wmjump
Only list windows on the current desktop. I recommend two separate keyboard shortcuts, for example: Alt-k for wmjump and Alt-j for wmjump --current.
Then pressing Alt-k shows all the windows on all desktops, so you can jump across desktops. On the other hand, pressing Alt-j shows only the windows on the current desktop. This is useful when you are running many windows, organized by the desktop. (For example, network applications on Desktop 1, games on Desktop 2, office suite on Desktop 3, etc.)
Use this option if you are on Compiz window manager (``wall''). The Compiz ``wall'' desktop is organized into a 2-dimensional grid. If you want to teleport to the viewport with coordinate x,y you should press two corresponding number keys. For example, to jump to x,y=2,3 press first 2 then 3.
Starting with v0.9 wmjump window is auto-destroyed on loss of focus. This is to prevent ``stray'' wmjump windows. But if wmjump is started with the --persist option, then the window will be preserved even after it loses the focus.
Use this option if you want to see the list of windows in reverse order.
This is a workaround for StumpWM, and maybe some other window managers. Sometimes wmjump can not properly determine the current workspace number (group number in StumpWM). But with the -g option you can write a wrapper script which explicitly tells wmjump on which desktop it is started. See SETUP section for an example of such a wrapper on StumpWM.
If you want to edit the configuration files, you should create a subdirectory .wmjump in your home directory, and then copy to this directory the files wmjump-rc and wmjump-blacklist which are found in /etc/wmjump/. Then you can edit these files. The file wmjump-rc defines the color and the text font of the buttons, depending on the window class of the application. You can learn the window classes of running windows by executing wmjump from the command line in a terminal. It will print a list of windows with classes, such as Navigator, emacs, opera etc. The file wmjump-blacklist contains the names of classes which you don't want to see in wmjump. For example gnome-panel and desktop_window
For StumpWM users. StumpWM is a tiling window manager. We tested wmjump on StumpWM 0.9.5. At this time wmjump cannot determine the desktop number (a.k.a ``group number'') if started on an empty desktop. As a workaround, we start wmjump with the following wrapping script in .stumpwmrc:
(define-key *top-map* (kbd "M-k") "exec wmjump --reverse") (define-key *top-map* (kbd "M-j") "eval-line (let ((dnum (stumpwm::tile-group-number (current-group)) )) (run-shell-command (concatenate 'string \"exec wmjump --current --reverse -g\" (write-to-string (- dnum 1)))) (stumpwm::tile-group-name (current-group)))")
This puts wmjump on META-k and wmjump --current on META-j. This wrapping script is to tell wmjump on which group it is started. It assumes that groups are numbered from 1 to up to 9. (Notice that wmjump looks up the group number only if started with the --current option. Without this option it does not need to know the desktop number.)
On Fvwm the windows are listed in random order rather than historical, making it much less useful.
Focus problems: sometimes the jumped window loses focus. This was only observed when running Opera. In Xfce the focus can be returned by pressing Alt-TAB. If this happens often, maybe try to recompile with different values of TIME_SHORT, TIME_MIDDLE and TIME_LONG in the definitions of main.c. Also, in Xfce, activating the "focus stealing prevention" helps. It is in Settings -> Settings Manager -> Window manager tweaks -> Focus.
The program makes use of the wmctrl source code. It is inspired by the Firefox extension Vimperator.
wmjump was written by Andrei Mikhailov <send email to a.mkhlv (at gmail)>.
Copyright (C) 2008. This program is free software which I release under the GNU General Public License. You may redistribute and/or modify this program under the terms of that license as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. To get a copy of the GNU General Puplic License, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.