Adding Keyboard Shortcuts

The system.fvwmrc file that we started with offers little in the way of keyboard shortcuts, or accelerators, for window management functions. But if you’re one of those users who prefer to keep their hands on the keyboard and off the mouse as much as possible, you can easily define keys in your .fvwm2rc file to perform a variety of functions.

Navigating the Desktop

The Pager is a great tool for getting around one or more desktops, but many people hate using the mouse. You can configure certain keys and key combinations to let you move around in various ways.

Add the following lines to your .fvwm2rc file to set up key combinations to scroll one page in any direction on the desktop using Ctrl plus an arrow key. The view scrolls in the direction of the arrow.

Each definition uses the Key variable followed by:

  1. The name of the key

  2. The context (location) in which it must be typed

  3. Any modifying keys that must also be held down

  4. The action initiated by the key or key combination

Thus, in the following example, the first definition line says that pressing the left arrow key (Left) in any (A) context, while also holding down the Ctrl (C) key scrolls the screen one page to the left on the current desktop:

# Press arrow + Control in any context
# to scroll by one page in the direction of the arrow
Key Left            A            C            Scroll -100 0
Key Right           A            C            Scroll +100 +0
Key Up              A            C            Scroll +0  -100
Key Down            A            C            Scroll +0  +100

Table 19-1 summarizes the functionality.

Table 19-1. Key combinations ...

Get Linux in a Nutshell, Fourth Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.