MWMRC(4)
π¦ mwmrc β the Motif Window Manager Resource Description File (special file)
ok so bestie, listen π this is the whole resource description file situation for mwm, the Motif window manager. It's a whole extra config file and it's lowkey the main character of how mwm behaves, so we're gonna go through it together, no cap.
β¨ NAME β¨
mwmrc β the Motif Window Manager Resource Description File
π DESCRIPTION π
The mwmrc file is a supplementary resource file that controls much of the behavior of the Motif window manager mwm. π«Ά It's where the descriptions of resources live β the ones that can't easily be written using standard X Window System, Version 11 resource syntax. The resource description file contains entries that are referred to by X resources in defaults files (for example, /usr/X11R6/lib/X11/app-defaults/Mwm) or in the RESOURCE_MANAGER property on the root window. Like, for example, the resource description file is what enables you to specify different types of window menus; however, an X resource is used to specify which of these window menus mwm should use for a particular window. So they tag-team, ok? π
π Location π
The window manager searches for one of the following resource description files, where $LANG is the value of the language environment on a per-user basis:
$HOME/$LANG/.mwmrc$HOME/.mwmrc/usr/X11R6/lib/X11/$LANG/system.mwmrc/usr/X11R6/lib/X11/system.mwmrc
The first file found is the first used. If no file is found, a set of built-in specifications is used. π
A particular resource description file can be selected using the configFile resource. And here's how you'd specify a different resource description file from the command line:
/usr/X11R6/bin/X11/mwm -xrm "mwm*configFile: mymwmrc"
π Resource Types π
The following types of resources can be described in the mwm resource description file:
- Buttons β Window manager functions can be bound (associated) with button events.
- Keys β Window manager functions can be bound (associated) with key press events.
- Menus β Menu panes can be used for the window menu and other menus posted with key bindings and button bindings.
π MWM RESOURCE DESCRIPTION FILE SYNTAX π
The mwm resource description file is a standard text file that contains items of information separated by blanks, tabs, and new lines characters. Blank lines are ignored. π¦
Items or characters can be quoted to avoid special interpretation (for example, the comment character can be quoted to prevent it from being interpreted as the comment character). A quoted item can be contained in double quotes (" "). Single characters can be quoted by preceding them by the back-slash character (\). If a line ends with a back-slash, the next line is considered a continuation of that line. β¨
All text from an unquoted # to the end of the line is regarded as a comment and is not interpreted as part of a resource description. And if ! is the first character in a line, the line is regarded as a comment too. π
π«Ά Window Manager Functions π«Ά
Window manager functions can be accessed with button and key bindings, and with window manager menus. Functions are indicated as part of the specifications for button and key binding sets, and menu panes. The function specification has the following syntax:
function = function_name [function_args]
function_name = window manager function
function_args = {quoted_item | unquoted_item}
The following functions are supported. If a function is specified that isn't one of the supported functions then it is interpreted by mwm as f.nop. π
f.beepβ This function causes a beep.f.circle_down [ icon | window]β This function causes the window or icon that is on the top of the window stack to be put on the bottom of the window stack (so that it is no longer obscuring any other window or icon). This function affects only those windows and icons that are obscuring other windows and icons, or that are obscured by other windows and icons. Secondary windows (that is, transient windows) are restacked with their associated primary window. Secondary windows always stay on top of the associated primary window and there can be no other primary windows between the secondary windows and their primary window. If aniconfunction argument is specified, then the function applies only to icons. If awindowfunction argument is specified then the function applies only to windows.f.circle_up [ icon | window]β This function raises the window or icon on the bottom of the window stack (so that it is not obscured by any other windows). This function affects only those windows and icons that are obscuring other windows and icons, or that are obscured by other windows and icons. Secondary windows (that is, transient windows) are restacked with their associated primary window. If aniconfunction argument is specified then the function applies only to icons. If anwindowfunction argument is specified then the function applies only to windows.f.exec command(or! command) β This function causescommandto be executed (using the value of the$MWMSHELLor$SHELLenvironment variable if set; otherwise,/bin/sh). The!notation can be used in place of thef.execfunction name.f.focus_colorβ This function sets the colormap focus to a client window. If this function is done in a root context, then the default colormap (setup by the X Window System for the screen wheremwmis running) is installed and there is no specific client window colormap focus. This function is treated asf.nopifcolormapFocusPolicyis notexplicit. πΈf.focus_keyβ This function sets the keyboard input focus to a client window or icon. This function is treated asf.nopifkeyboardFocusPolicyis notexplicitor the function is executed in a root context.f.killβ This function is used to close application windows. The actual processing that occurs depends on the protocols that the application observes. The application lists the protocols it observes in theWM_PROTOCOLSproperty on its top level window. If the application observes theWM_DELETE_WINDOWprotocol, it is sent a message that requests the window be deleted. If the application observes bothWM_DELETE_WINDOWandWM_SAVE_YOURSELF, it is sent one message requesting the window be deleted and another message advising it to save its state. If the application observes only theWM_SAVE_YOURSELFprotocol, it is sent a message advising it to save its state. After a delay (specified by the resourcequitTimeout), the application's connection to the X server is terminated. If the application observes neither of these protocols, its connection to the X server is terminated. πf.lower [- client | within | freeFamily]β This function lowers a primary window to the bottom of the global window stack (where it obscures no other window) and lowers the secondary window (transient window or dialog box) within the client family. The arguments to this function are mutually exclusive. Theclientargument indicates the name or class of a client to lower. The name or class of a client appears in theWM_CLASSproperty on the client's top-level window. If theclientargument is not specified, the context that the function was invoked in indicates the window or icon to lower. Specifyingwithinlowers the secondary window within the family (staying above the parent) but does not lower the client family in the global window stack. SpecifyingfreeFamilylowers the window to the bottom of the global windows stack from its local family stack.f.maximizeβ This function causes a client window to be displayed with its maximum size. Refer to themaximumClientSize,maximumMaximumSize, andlimitResizeresources inmwm(1). π₯f.menu menu_nameβ This function associates a cascading (pull-right) menu with a menu pane entry or a menu with a button or key binding. Themenu_namefunction argument identifies the menu to be used.f.minimizeβ This function causes a client window to be minimized (iconified). When a window is minimized with no icon box in use, and if thelowerOnIconifyresource has the valueTrue(the default), the icon is placed on the bottom of the window stack (such that it obscures no other window). If an icon box is used, then the client's icon changes to its iconified form inside the icon box. Secondary windows (that is, transient windows) are minimized with their associated primary window. There is only one icon for a primary window and all its secondary windows. πf.moveβ This function initiates an interactive move of a client window.f.next_cmapβ This function installs the next colormap in the list of colormaps for the window with the colormap focus.f.next_key [ icon | window | transient]β This function sets the keyboard input focus to the next window/icon in the set of windows/icons managed by the window manager (the ordering of this set is based on the stacking of windows on the screen). This function is treated asf.nopifkeyboardFocusPolicyis notexplicit. The keyboard input focus is only moved to windows that do not have an associated secondary window that is application modal. If thetransientargument is specified, then transient (secondary) windows are traversed (otherwise, if onlywindowis specified, traversal is done only to the last focused window in a transient group). If aniconfunction argument is specified, then the function applies only to icons. If awindowfunction argument is specified, then the function applies only to windows.f.nopβ This function does nothing. (iconic, honestly π )f.normalizeβ This function causes a client window to be displayed with its normal size. Secondary windows (that is, transient windows) are placed in their normal state along with their associated primary window.f.normalize_and_raiseβ This function causes a client window to be displayed with its normal size and raised to the top of the window stack. Secondary windows (that is, transient windows) are placed in their normal state along with their associated primary window. β¨f.pack_iconsβ This is the glow-up button for your icons π It relayouts icons (based on whatever layout policy is in use) on the root window or inside the icon box. Basically: icons get βpackedβ into the icon grid. Slay.f.pass_keysβ This toggles key-binding processing for window manager functions on/off. When it turns key-binding processing off, every key gets passed straight to the window that has keyboard input focus, and no window manager functions get invoked. Cute detail: if you invokef.pass_keyswith a key binding to disable key-binding processing, the same key binding can be used to enable it again. Toggle icon behavior β¨f.post_wmenuβ Posts the window menu. If a key is used to post the window menu and a window menu button is present, the window menu is automatically placed with its top-left corner at the bottom-left corner of the window menu button for the client window. If thereβs no window menu button, the window menu is placed at the top-left corner of the client window. Placement is giving main-character energy πf.prev_cmapβ Installs the previous colormap in the list of colormaps for the window with the colormap focus. Colormap lore, but make it fashion πf.prev_key [ icon | window | transient]β Sets the keyboard input focus to the previous window/icon in the set of windows/icons managed by the window manager. The ordering of this set is based on the stacking of windows on the screen. This function is treated asf.nopifkeyboardFocusPolicyis notexplicit. The keyboard input focus is only moved to windows that do not have an associated secondary window that is application modal. If thetransientargument is specified, then transient (secondary) windows are traversed; otherwise, if onlywindowis specified, traversal is done only to the last focused window in a transient group. If aniconfunction argument is specified, then the function applies only to icons. If awindowfunction argument is specified, then the function applies only to windows. Focus tea βοΈf.quit_mwmβ Terminatesmwm(but NOT the X window system). This is the βlog off, bestieβ button πf.raise [-client | within | freeFamily]β Raises a primary window to the top of the global window stack (where it is obscured by no other window) and raises the secondary window (transient window or dialog box) within the client family. The arguments to this function are mutually exclusive. The-clientargument indicates the name or class of a client to lower. If-clientis not specified, the context that the function was invoked in indicates the window or icon to lower. Specifyingwithinraises the secondary window within the family but does not raise the client family in the global window stack. SpecifyingfreeFamilyraises the window to the top of its local family stack and raises the family to the top of the global window stack. Stacking order said βstep asideβ πf.raise_lower [ within | freeFamily]β Raises a primary window to the top of the global window stack if it is partially obscured by another window; otherwise, it lowers the window to the bottom of the window stack. The arguments to this function are mutually exclusive. Specifyingwithinraises a secondary window within the family (staying above the parent window), if it is partially obscured by another window in the applicationβs family; otherwise, it lowers the window to the bottom of the family stack. It has no effect on the global window stacking order. SpecifyingfreeFamilyraises the window to the top of its local family stack, if obscured by another window, and raises the family to the top of the global window stack; otherwise, it lowers the window to the bottom of its local family stack and lowers the family to the bottom of the global window stack. Itβs giving βchoose your fighterβ π«Άf.refreshβ Causes all windows to be redrawn. A whole-screen reset moment β¨f.refresh_winβ Causes a client window to be redrawn. Just one windowβs little refresh πf.resizeβ Initiates an interactive resize of a client window. Drag, bestie, drag πf.restoreβ Restores the previous state of an iconβs associated window. If a maximized window is iconified, thenf.restorerestores it to its maximized state. If a normal window is iconified, thenf.restorerestores it to its normalized state. Icon un-shrink era π¦f.restore_and_raiseβ Restores the previous state of an iconβs associated window and raises the window to the top of the window stack. If a maximized window is iconified, thenf.restore_and_raiserestores it to its maximized state and raises it to the top of the window stack. If a normal window is iconified, thenf.restore_and_raiserestores it to its normalized state and raises it to the top of the window stack. Restore plus main-character entrance π₯f.restartβ Causesmwmto be restarted (effectively terminated and re-executed). Restart is necessary formwmto incorporate changes in both themwmrcfile and X resources. The βhave you tried turning it off and on againβ of window manager configs πf.screen [ next | prev | back | screen_number]β Causes the pointer to warp to a specific screen number or to the next, previous, or last visited (back) screen. The arguments to this function are mutually exclusive. Thescreen_numberargument indicates the screen number that the pointer is to be warped to. Screens are numbered starting from screen0. Specifyingnextcauses the pointer to warp to the next managed screen (skipping over any unmanaged screens). Specifyingprevcauses the pointer to warp to the previous managed screen (skipping over any unmanaged screens). Specifyingbackcauses the pointer to warp to the last visited screen. Screen-hopping, but make it chic πΈf.send_msg message_numberβ Sends anXClientMessageEventof type_MOTIF_WM_MESSAGESwithmessage_typeset tomessage_number. The client message is sent only ifmessage_numberis included in the clientβs_MOTIF_WM_MESSAGESproperty. A menu item label is grayed out if the menu item is used to dof.send_msgof a message that is not included in the clientβs_MOTIF_WM_MESSAGESproperty. Respect the property list, fr fr π«‘f.separatorβ Causes a menu separator to be put in the menu pane at the specified location. The label is ignored. Purely aesthetic divider energy πf.set_behaviorβ Causes the window manager to restart with the default behavior (if a custom behavior is configured) or a custom behavior (if a default behavior is configured). By default this is bound toShift Ctrl Alt <Key>!. Behavior flip, iconically πf.titleβ Inserts a title in the menu pane at the specified location. Menu section header moment β¨f.versionβ Causes the window manager to display its release version in a dialog box. Version reveal! π
Function Constraints π«Ά
Each function may be constrained as to which resource types can specify the function (for example, menu pane) and also what context the function can be used in (for example, the function is done to the selected client window). Function contexts are:
rootβ No client window or icon has been selected as an object for the function.windowβ A client window has been selected as an object for the function. This includes the windowβs title bar and frame. Some functions are applied only when the window is in its normalized state (for example,f.maximize) or its maximized state (for example,f.normalize).iconβ An icon has been selected as an object for the function.
If a function is specified in a type of resource where it is not supported or is invoked in a context that does not apply, then the function is treated as f.nop. The following table indicates the resource types and function contexts in which window manager functions apply.
okay so hereβs the function cheat sheet, bestie β each row is a function, where it can live (Contexts), and what can trigger it (Resources) π
f.beepβ contexts:root,icon,window; resources:button,key,menuβ¨f.circle_downβ contexts:root,icon,window; resources:button,key,menuβ¨f.circle_upβ contexts:root,icon,window; resources:button,key,menuβ¨f.execβ contexts:root,icon,window; resources:button,key,menuβ¨f.focus_colorβ contexts:root,icon,window; resources:button,key,menuβ¨f.focus_keyβ contexts:root,icon,window; resources:button,key,menuβ¨f.killβ contexts:icon,window; resources:button,key,menuβ¨f.lowerβ contexts:root,icon,window; resources:button,key,menuβ¨f.maximizeβ contexts:icon,window(normal); resources:button,key,menuβ¨f.menuβ contexts:root,icon,window; resources:button,key,menuβ¨f.minimizeβ contexts:window; resources:button,key,menuβ¨f.moveβ contexts:icon,window; resources:button,key,menuβ¨f.next_cmapβ contexts:root,icon,window; resources:button,key,menuβ¨f.next_keyβ contexts:root,icon,window; resources:button,key,menuβ¨f.nopβ contexts:root,icon,window; resources:button,key,menuβ¨f.normalizeβ contexts:icon,window(maximized); resources:button,key,menuβ¨f.normalize_and_raiseβ contexts:icon,window; resources:button,key,menuβ¨f.pack_iconsβ contexts:root,icon,window; resources:button,key,menuβ¨f.pass_keysβ contexts:root,icon,window; resources:button,key,menuβ¨f.post_wmenuβ contexts:root,icon,window; resources:button,keyβ¨f.prev_cmapβ contexts:root,icon,window; resources:button,key,menuβ¨f.prev_keyβ contexts:root,icon,window; resources:button,key,menuβ¨f.quit_mwmβ contexts:root; resources:button,key,menu (root only)β¨f.raiseβ contexts:root,icon,window; resources:button,key,menuβ¨f.raise_lowerβ contexts:icon,window; resources:button,key,menuβ¨f.refreshβ contexts:root,icon,window; resources:button,key,menuβ¨f.refresh_winβ contexts:window; resources:button,key,menuβ¨f.resizeβ contexts:window; resources:button,key,menuβ¨f.restartβ contexts:root; resources:button,key,menu (root only)β¨f.restoreβ contexts:icon,window; resources:button,key,menuβ¨f.restore_and_raiseβ contexts:icon,window; resources:button,key,menuβ¨f.screenβ contexts:root,icon,window; resources:button,key,menuβ¨f.send_msgβ contexts:icon,window; resources:button,key,menuβ¨f.separatorβ contexts:root,icon,window; resources:menuβ¨f.set_behaviorβ contexts:root,icon,window; resources:button,key,menuβ¨f.titleβ contexts:root,icon,window; resources:menuβ¨f.versionβ contexts:root,icon,window; resources:button,key,menuβ¨
π WINDOW MANAGER EVENT SPECIFICATION π
Events show up inside the specs for button binding sets, key binding sets, and menu panes. Button events are written like this, no cap:
button =~[modifier_list ]<button_event_name >
modifier_list =~modifier_name { modifier_name}
β¨ modifier_name values β¨
These are the values you can use for modifier_name, bestie. Note that [Alt] and [Meta] can be used interchangeably on some hardware π
Ctrlβ Control KeyShiftβ Shift KeyAltβ Alt KeyMetaβ Meta KeyMod1β Modifier1Mod2β Modifier2Mod3β Modifier3Mod4β Modifier4Mod5β Modifier5
Locking modifiers are ignored when processing button and key bindings. The following table lists keys that are interpreted as locking modifiers. The X server may map some of these symbols to the Mod1 - Mod5 modifier keys. These keys may or may not be available on your hardware: Key Symbol
Caps LockShift LockKana LockNum LockScroll Lock
π button_event_name values π
The following table indicates the values that can be used for button_event_name:
Btn1Downβ Button 1 PressBtn1Upβ Button 1 ReleaseBtn1Clickβ Button 1 Press and ReleaseBtn1Click2β Button 1 Double ClickBtn2Downβ Button 2 PressBtn2Upβ Button 2 ReleaseBtn2Clickβ Button 2 Press and ReleaseBtn2Click2β Button 2 Double ClickBtn3Downβ Button 3 PressBtn3Upβ Button 3 ReleaseBtn3Clickβ Button 3 Press and ReleaseBtn3Click2β Button 3 Double ClickBtn4Downβ Button 4 PressBtn4Upβ Button 4 ReleaseBtn4Clickβ Button 4 Press and ReleaseBtn4Click2β Button 4 Double ClickBtn5Downβ Button 5 PressBtn5Upβ Button 5 ReleaseBtn5Clickβ Button 5 Press and ReleaseBtn5Click2β Button 5 Double Click
π¦ key events π¦
Key events that are used by the window manager for menu mnemonics and for binding to window manager functions are single key presses; key releases are ignored. Key events have the following syntax:
key =~[modifier_list] <Key>key_name
modifier_list =~modifier_name { modifier_name}
All modifiers specified are interpreted as being exclusive (this means that only the specified modifiers can be present when the key event occurs). Modifiers for keys are the same as those that apply to buttons. The key_name is an X11 keysym name. Keysym names can be found in the keysymdef.h file (remove the XK_ prefix).
π BUTTON BINDINGS π
The buttonBindings resource value is the name of a set of button bindings that are used to configure window manager behavior. A window manager function can be done when a button press occurs with the pointer over a framed client window, an icon or the root window. The context for indicating where the button press applies is also the context for invoking the window manager function when the button press is done (significant for functions that are context sensitive). The button binding syntax is:
Buttons bindings_set_name
{
button context function
button context function
...
button context function
}
The syntax for the context specification is:
context = object[| context]
object = root | icon | window | title | frame | border | app
The context specification indicates where the pointer must be for the button binding to be effective. For example, a context of window indicates that the pointer must be over a client window or window management frame for the button binding to be effective. The frame context is for the window management frame around a client window (including the border and titlebar), the border context is for the border part of the window management frame (not including the titlebar), the title context is for the title area of the window management frame, and the app context is for the application window (not including the window management frame). If an f.nop function is specified for a button binding, the button binding is not done.
πΈ KEY BINDINGS πΈ
The keyBindings resource value is the name of a set of key bindings that are used to configure window manager behavior. A window manager function can be done when a particular key is pressed. The context in which the key binding applies is indicated in the key binding specification. The valid contexts are the same as those that apply to button bindings. The key binding syntax is:
Keys bindings_set_name
{
key context function
key context function
...
key context function
}
If an f.nop function is specified for a key binding, the key binding is not done. If an f.post_wmenu or f.menu function is bound to a key, mwm automatically uses the same key for removing the menu from the screen after it has been popped up. The context specification syntax is the same as for button bindings with one addition. The context ifkey may be specified for binding keys that may not be available on all displays. If the key is not available and if ifkey is in the context, then reporting of the error message to the error log is suppressed. This feature is useful for networked, heterogeneous environments. For key bindings, the frame, title, border, and app contexts are equivalent to the window context. The context for a key event is the window or icon that has the keyboard input focus (root if no window or icon has the keyboard input focus).
π MENU PANES π
Menus can be popped up using the f.post_wmenu and f.menu window manager functions. The context for window manager functions that are done from a menu is root, icon or window depending on how the menu was popped up. In the case of the window menu or menus popped up with a key binding, the location of the keyboard input focus indicates the context. For menus popped up using a button binding, the context of the button binding is the context of the menu. The menu pane specification syntax is:
Menu menu_name
{
label [mnemonic] [accelerator ] function
label [mnemonic] [accelerator ] function
...
label [mnemonic] [accelerator ] function
}
Each line in the Menu specification identifies the label for a menu item and the function to be done if the menu item is selected. Optionally a menu button mnemonic and a menu button keyboard accelerator may be specified. Mnemonics are functional only when the menu is posted and keyboard traversal applies. The label may be a string or a bitmap file. The label specification has the following syntax:
label = text | bitmap_file
bitmap_file = @file_name
text = quoted_item | unquoted_item
The string encoding for labels must be compatible with the menu font that is used. Labels are greyed out for menu items that do the f.nop function or an invalid function or a function that doesn't apply in the current context. A mnemonic specification has the following syntax:
mnemonic = _ character
The first matching character in the label is underlined. If there is no matching character in the label, no mnemonic is registered with the window manager for that label. Although the character must exactly match a character in the label, the mnemonic does not execute if any modifier (such as Shift) is pressed with the character key. The accelerator specification is a key event specification with the same syntax as is used for key bindings to window manager functions.
π INCLUDING FILES π
Okay bestie, you can absolutely pull other files into your mwmrc file using the include construct. Itβs giving βbring your friends to the functionβ energy. For example:
INCLUDE
{
/usr/local/shared/mwm.menus
/home/kmt/personal/my.bindings
}
This causes the files named to be read in and interpreted in order as an additional part of the mwmrc file. Slay. β¨
Important vibe check: Include is a top-level construct. It cannot be nested inside another construct. No inception nonsense, okay? π
π WARNINGS π
Errors that occur during the processing of the resource description file are recorded in: $HOME/.mwm/errorlog. So if the appearance or behavior of mwm is not what you expect, bestie, check this file. Itβs literally right there with the receipts. π«Ά
π FILES π
Hereβs the file lineup, no cap:
$HOME/$LANG/.mwmrc$HOME/.mwmrc/usr/X11R6/lib/X11/$LANG/system.mwmrc/usr/X11R6/lib/X11/system.mwmrc
π RELATED INFORMATION π
mwm(1)X(1)
And thatβs the page, bestie β footer check: source/version tag is mwmrc(special file), and the date wasnβt printed in this footer, so weβre leaving that part mysterious. Cute sign-off complete π
β¨π
π¦ where this page comes from
- alpine 3.24: motif-doc 2.5.2-r0 Β· LGPL-2.1-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms