Configuring window manager button bindings

Example of creating a new button set

This section provides a comprehensive example that ties together some of the concepts and procedures discussed in this chapter.

The following example assumes that you are using the default pmwm mode of the window manager, that you want to create a new button binding set for your local environment, and you want to name the set ``MyButtonBindings''. MyButtonBindings consists of five new button binding definitions that produce the following results:

To create this new set:

  1. Open the .pmwmrc file in your $HOME directory for editing. (If .pmwmrc does not already exist, create it by copying /usr/lib/X11/system.pmwmrc to .mwmrc in your $HOME directory).

  2. Locate the ``DefaultButtonBindings'' section in the .pmwmrc file and place a copy of the section underneath the default definitions. You can use this copy as a template for your new button binding set.

  3. In the copy of the default definitions, rename ``DefaultButtonBindings'' to ``MyButtonBindings.''

  4. Edit the template so that it looks like this:
        1   #
        2   # button binding descriptions
        3   #
        4   Buttons MyButtonBindings
        5   {
        6       <Btn1Down>       root MyRootMenu
        7       <Btn1Down>       frame         f.raise
        8       <Btn2Down>       frame|icon    f.post_wmenu
        9       <Btn3Down>       frame|icon    f.post_wmenu
       10       Meta<Btn1Down>   icon|window   f.raise_lower
       11       Meta<Btn2Down>   window        f.focus_color
    Note that for the f.focus_color function to have an effect, the pmwm colormapFocusPolicy resource must be set to ``explicit''. See ``Customizing the window manager'' and ``OSF/Motif window manager resources'' for more information.

  5. Define the buttonBindings resource to announce the new button binding set to the window manager. Specify the resource in the $HOME/.Xdefaults-hostname file, where hostname is the name of the host, or machine, where the window manager is running. The resource specification should look like this:

    Pmwm*buttonBindings: MyButtonBindings

  6. Restart the window manager so that the new button binding information is implemented.

Previous topic: Step 5: Restarting the window manager

© 2005 The SCO Group, Inc. All rights reserved.
SCO OpenServer Release 6.0.0 -- 26 May 2005