CWMRC(5)

NAME
cwmrc - samu window manager configuration file

DESCRIPTION
This manual page describes the cwm(1) configuration file.

The current line can be extended over multiple lines using a backslash (‘\’). Comments can be put anywhere in the file using a hash mark (‘#’), and extend to the end of the current line. Care should be taken when commenting out multi-line text: the comment is effective until the end of the entire block.

Arguments containing whitespace should be surrounded by double quotes (").

The following options are accepted:

autogroup group [windowname,]windowclass
    Automatically add new windows to group if their class property matches windowclass, or if their name and class properties match windowname and windowclass, respectively. The more specific last match wins. group is a number between 0 and 9. If group is 0, matching windows will not be added to any group; this may be used to override “sticky group mode”.

    The name and class values, respectively, for existing windows are both set in the WM_CLASS property and may be obtained using xprop(1).

bind-key key function
    Bind or rebind key key to function. The modifier keys come first, followed by a ‘-’, then a keysym name, taken from /usr/X11R6/include/X11/keysymdef.h.

    The following modifiers are recognised:

    C   Control key.
    M   Meta key.
    S   Shift key.
    4   Mod4 (windows) key.
    5   Mod5 (AltGr) key.

    The function may either be one from the BIND FUNCTION LIST (see below) or the command line that is to be executed.

bind-mouse button function
    Bind or rebind button button to function. The modifier keys come first, followed by a ‘-’, then the button number.

    The same modifiers are recognised as for key in bind-key.

    The following buttons are recognised:

    1   Left mouse button.
    2   Middle mouse button.
    3   Right mouse button.
    4   Scroll up mouse button.
    5   Scroll down mouse button.

    The function may be taken from the BIND FUNCTION LIST (see below) or the command line that is to be executed.

borderwidth pixels
    Set the window border width to pixels.

color activeborder color
    Set the color of the active border.

color font color
    Set menu font color.

color selfont color
    Set font color for selected menu item.

color groupborder color
    Set the color of the border while grouping a window.

color inactiveborder color
    Set the color of the inactive border.

color menubg color
    Set menu background color.

color menufg color
    Set menu foreground color.

color urgencyborder color
    Set the color of the border of a window indicating urgency.

color ungroupborder color
    Set the color of the border while ungrouping a window.

command name path
    Every name entry is shown in the application menu. When selected, the defined path is executed with execvp(3).

    The name entries term and lock have a special meaning. They point to the terminal and screen locking programs specified by key bindings. The defaults are xterm(1) and xlock(1), respectively.

fontname font
    Change the default font for Xft(3).

gap top bottom left right
    Define a “gap” in pixels at the edge of the screen, so that when a window is maximized it will not overlap this area. This “gap” can be used for applications such as xclock(1), where the user may wish to remain visible.

htile percent
    Set the percentage of screen the master window should occupy after calling window-htile. If set to 0, the horizontal size of the master window will remain unchanged. The default is 50.

ignore windowname
    Ignore, and do not warp to, windows with the name windowname when drawing borders and cycling through windows.

moveamount pixels
    Set a default size for the keyboard movement bindings, in pixels. The default is 1.

snapdist pixels
    Minimum distance to snap-to adjacent edge, in pixels. The default is 0.

sticky yes|no
    Toggle sticky group mode. The default behavior for new windows is to not assign any group. By enabling sticky group mode, cwm(1) will assign new windows to the currently selected group.

unbind-key key
    Unbind function bound to key. A special key keyword “all” can be used to unbind all keys.

unbind-mouse button
    Unbind function bound to button. A special button keyword “all” can be used to unbind all buttons.

vtile percent
    Set the percentage of screen the master window should occupy after calling window-vtile. If set to 0, the vertical size of the master window will remain unchanged. The default is 50.

wm name path
    Every name entry is shown in the wm menu. When selected, the window manager is replaced by path.

BIND FUNCTION LIST
restart
    Restart the running cwm(1).
quit
    Quit cwm(1).
terminal
    Spawn a new terminal.
lock
    Lock the screen.
menu-window
    Launch window search menu.
menu-window-hidden
    Launch hidden window search menu.
menu-cmd
    Launch application search menu.
menu-group
    Launch group search menu.
menu-exec
    Launch “exec program” menu.
menu-exec-wm
    Launch “exec WindowManager” menu.
menu-ssh
    Launch “ssh” menu.
group-toggle-[n]
    Toggle visibility of group n, where n is 1-9.
group-only-[n]
    Show only group n, where n is 1-9, hiding other groups.
group-last
    Show only the previously active group.
group-close-[n]
    Close all windows in group n, where n is 1-9.
group-toggle-all
    Toggle visibility of all groups.
window-group
    Toggle group membership of current window.
window-movetogroup-[n]
    Hide current window from display and move to group n, where n is 1-9.
group-cycle
    Forward cycle through groups.
group-rcycle
    Reverse cycle through groups.
window-cycle
    Forward cycle through windows.
window-rcycle
    Reverse cycle through windows.
window-cycle-ingroup
    Forward cycle through windows in current group.
window-rcycle-ingroup
    Reverse cycle through windows in current group.
window-close
    Close current window.
window-hide
    Hide current window.
window-lower
    Lower current window.
window-raise
    Raise current window.
window-menu-label
    Label current window.
window-freeze
    Freeze current window geometry.
window-stick
    Stick current window to all groups (same as assigning to nogroup).
window-fullscreen
    Full-screen current window (gap + border removed).
window-maximize
    Maximize current window (gap + border honored).
window-vmaximize
    Vertically maximize current window (gap + border honored).
window-hmaximize
    Horizontally maximize current window (gap + border honored).
window-htile
    Current window is placed at the top of the screen, maximized horizontally and resized to htile (default half) of the vertical screen space. Other windows in its group share remaining screen space.
window-vtile
    Current window is placed on the left of the screen, maximized vertically and resized to vtile (default half) of the horizontal screen space. Other windows in its group share remaining screen space.
window-move
    Move current window.
window-resize
    Resize current window.
window-move-up
    Move window moveamount pixels up.
window-move-down
    Move window moveamount pixels down.
window-move-right
    Move window moveamount pixels right.
window-move-left
    Move window moveamount pixels left.
window-move-up-big
    Move window 10 times moveamount pixels up.
window-move-down-big
    Move window 10 times moveamount pixels down.
window-move-right-big
    Move window 10 times moveamount pixels right.
window-move-left-big
    Move window 10 times moveamount pixels left.
window-resize-up
    Resize window moveamount pixels up.
window-resize-down
    Resize window moveamount pixels down.
window-resize-right
    Resize window moveamount pixels right.
window-resize-left
    Resize window moveamount pixels left.
window-resize-up-big
    Resize window 10 times moveamount pixels up.
window-resize-down-big
    Resize window 10 times moveamount pixels down.
window-resize-right-big
    Resize window 10 times moveamount pixels right.
window-resize-left-big
    Resize window 10 times moveamount pixels left.
window-snap-up
    Snap window to top edge.
window-snap-down
    Snap window to bottom edge.
window-snap-right
    Snap window to right edge.
window-snap-left
    Snap window to left edge.
window-snap-up-right
    Snap window to top-right corner.
window-snap-up-left
    Snap window to top-left corner.
window-snap-down-right
    Snap window to bottom-right corner.
window-snap-down-left
    Snap window to bottom-left corner.
window-tile-up
    Fill the top half of the screen with the window.
window-tile-down
    Fill the bottom half of the screen with the window.
window-tile-left
    Fill the left half of the screen with the window.
window-tile-right
    Fill the right half of the screen with the window.
window-tile-up-left
    Fill the top left quarter of the screen with the window.
window-tile-up-right
    Fill the top right quarter of the screen with the window.
window-tile-down-left
    Fill the down left quarter of the screen with the window.
window-tile-down-right
    Fill the down right quarter of the screen with the window.
window-center
    Centers the window on the screen.
pointer-move-up
    Move pointer moveamount pixels up.
pointer-move-down
    Move pointer moveamount pixels down.
pointer-move-right
    Move pointer moveamount pixels right.
pointer-move-left
    Move pointer moveamount pixels left.
pointer-move-up-big
    Move pointer 10 times moveamount pixels up.
pointer-move-down-big
    Move pointer 10 times moveamount pixels down.
pointer-move-right-big
    Move pointer 10 times moveamount pixels right.
pointer-move-left-big
    Move pointer 10 times moveamount pixels left.

FILES
~/.cwmrc
    Default cwm(1) configuration file.

EXAMPLES

    # Set default Xft(3) font
    fontname "sans-serif:pixelsize=14:bold"
    # Turn on sticky-group mode
    sticky yes
    # Any entry here is shown in the application menu
    command firefox		firefox
    command xmms		xmms
    command top		"xterm -e top"
    # Autogroup definitions
    autogroup 3 "aterm,XTerm"
    autogroup 3 "xterm,XTerm"
    # Ignore programs by that name by not drawing borders around them.
    ignore XMMS
    ignore xwi
    ignore xapm
    ignore xclock
    # Key bindings
    bind-key CM-r		window-menu-label
    bind-key CS-Return	"xterm -e top"
    bind-key C4-equal	window-vmaximize
    bind-key C4S-equal	window-hmaximize
    bind-key M-1		group-only-1
    bind-key M-2		group-only-2
    bind-key M-3		group-only-3
    bind-key MS-1		window-movetogroup-1
    bind-key MS-2		window-movetogroup-2
    bind-key MS-3		window-movetogroup-3
    unbind-key 4-o
    unbind-key CM-equal
    unbind-key CMS-equal
    # Mouse bindings
    bind-mouse M-2		window-lower
    bind-mouse M-3		window-resize

SEE ALSO
cwm(1)

HISTORY
The cwmrc file format first appeared in OpenBSD 4.4.