[Contents] [Index] [Next] [Previous]

Understanding the Resource Description File


The supplementary mwm resource description file contains specifications for menus, key bindings, and mouse bindings that are referred to by entries in the .Xdefaults file and other files that the window manager uses to create the resource database. If you do not have a .mwmrc file in your home directory, copy the system resource description file into your home directory with the following command:

cp /usr/lib/X11/system.mwmrc ~/.mwmrc 

You can freely modify the local copy of the resource description file to customize your Motif environment.

The configFile resource specifies the pathname for the mwm resource description file. If the pathname begins with ~/ (a tilde followed by a slash), mwm considers it to be relative to your home directory (as specified by the HOME environment variable). If the LANG environment variable is set, mwm looks for $HOME/$LANG/configFile. If that file does not exist or if LANG is not set, mwm looks for $HOME/configFile.

If the configFile pathname does not begin with ~/ (a tilde followed by a slash), mwm considers it to be relative to the current working directory.

User actions, such as keystrokes, are associated with predefined window manager functions. Each function has a name that begins with an f. (f dot) character sequence. In general, the meaning of the function is evident from its name. (See the mwm reference page in the OSF/Motif Programmer's Reference for more information on these functions.)

beep
Causes a beep.

circle_down
Moves the top window to the bottom of the window stack.

circle_up
Moves the bottom window to the top of the window stack.

exec or !
Executes the following shell command.

focus_color
Sets the colormap focus to a window.

focus_key
Sets the keyboard input focus to a window.

kill
Kills an application and its window.

lower
Moves a window to the bottom of the window stack.

maximize
Maximizes a window.

menu
Activates the named menu. This function can be used to create cascading and Popup Menus.

minimize
Iconifies a window.

move
Starts an interactive move for a window. Moves the keyboard input focus to the next window in the window stack.

nop
Does nothing.

normalize
Causes an icon or a maximized window to be displayed at its normal size.

normalize_and_raise
Causes an icon or a maximized window to be displayed at its normal size and raised to the top of the window stack.

pack_icons
Reorganizes the icons according to the current icon placement policy.

pass_keys
Toggles the use of special key bindings.

post_wmenu
Posts the Window menu.

prev_key
Moves the keyboard input focus to the previous window in the window stack.

quit_mwm
Exits the window manager without exiting the X Window System.

raise
Raises a window to the top of the window stack.

raise_lower
If obscured, raises a window to the top of the window stack; otherwise, lowers it to the bottom of the window stack.

refresh
Redraws all the windows on the screen.

refresh_win
Redraws a single window.

resize
Starts an interactive resize for a window.

restart
Stops and restarts the window manager.

restore
Restores an iconified window to its previous state.

restore_and_raise
Restores an iconified window to its previous state and raises it to the top of its stack.

screen
Moves a pointer to a specific screen.

send_msg
Sends a client message to the application.

separator
Draws a separator in a menu pane.

set_behavior
Restarts the window manager with the default behavior or reverts to any custom behavior.

title
Inserts a title in a menu pane.

The .mwmrc file defines named groups of key bindings, button bindings, and menu definitions. These groups are referenced by name as values for mwm resources, such as keyBindings and buttonBindings.

For example, if you wanted to define alternative responses for mouse button actions, you would create the named set of bindings (for instance, MyButtonBindings) in the .mwmrc file and reference those bindings in your .Xdefaults file as follows:

Mwm*buttonBindings: MyButtonBindings

The following sections describe the syntax for defining menus, key bindings and button bindings.