CWMRC(5)

okay bestie, welcome to CWMRC(5) from the File Formats Manual β€” this is the cwmrc(5) page, aka the config-file manual for cwm(1), and we are gonna get you comfy with it πŸ’…βœ¨

πŸ’– NAME πŸ’–

cwmrc β€” calm window manager configuration file 🌸

πŸ¦‹ DESCRIPTION πŸ¦‹

this page is literally the manual for the cwm(1) configuration file. main character energy for your window manager setup, no cap πŸ‘‘

✨ syntax tea first ✨

okay so 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 they 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 options, bestie πŸ’…

the following options are accepted β€” yes, all of them, we are not skipping a single one 🫢

  • 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 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), and 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 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), and 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 πŸŽ€

okay bestie, this is the whole function menu β€” every name is literal, so type it exactly like it’s written. no vibes-based renaming, i beg πŸ’…

  • restart β€” restarts the running cwm(1).
  • quit β€” quits cwm(1).
  • terminal β€” spawns a new terminal.
  • lock β€” locks the screen.
  • menu-window β€” launches the window search menu.
  • menu-window-hidden β€” launches the hidden window search menu.
  • menu-cmd β€” launches the application search menu.
  • menu-group β€” launches the group search menu.
  • menu-exec β€” launches the β€œexec program” menu.
  • menu-exec-wm β€” launches the β€œexec WindowManager” menu.
  • menu-ssh β€” launches the β€œssh” menu.
  • group-toggle-[n] β€” toggles visibility of group n, where n is 1-9.
  • group-only-[n] β€” shows only group n, where n is 1-9, hiding the other groups.
  • group-last β€” shows only the previously active group.
  • group-close-[n] β€” closes all windows in group n, where n is 1-9.
  • group-toggle-all β€” toggles visibility of all groups.
  • window-group β€” toggles group membership of the current window.
  • window-movetogroup-[n] β€” hides the current window from display and moves it to group n, where n is 1-9.
  • group-cycle β€” forward cycles through groups.
  • group-rcycle β€” reverse cycles through groups.
  • window-cycle β€” forward cycles through windows.
  • window-rcycle β€” reverse cycles through windows.
  • window-cycle-ingroup β€” forward cycles through windows in the current group.
  • window-rcycle-ingroup β€” reverse cycles through windows in the current group.
  • window-cycle-inclass β€” forward cycles through windows of the current window class.
  • window-rcycle-inclass β€” reverse cycles through windows of the current window class.
  • window-close β€” closes the current window.
  • window-hide β€” hides the current window.
  • window-lower β€” lowers the current window.
  • window-raise β€” raises the current window.
  • window-menu-label β€” labels the current window.
  • window-freeze β€” freezes the current window geometry.
  • window-stick β€” sticks the current window to all groups (same as assigning to nogroup).
  • window-fullscreen β€” full-screens the current window (gap + border removed).
  • window-maximize β€” maximizes the current window (gap + border honored).
  • window-vmaximize β€” vertically maximizes the current window (gap + border honored).
  • window-hmaximize β€” horizontally maximizes the current window (gap + border honored).
  • window-htile β€” places the current window at the top of the screen, maximizes it horizontally, and resizes it to htile (default half) of the vertical screen space. other windows in its group share the remaining screen space 🫢
  • window-vtile β€” places the current window on the left of the screen, maximizes it vertically, and resizes it to vtile (default half) of the horizontal screen space. other windows in its group share the remaining screen space 🫢
  • window-move β€” moves the current window.
  • window-resize β€” resizes the current window.
  • window-move-up β€” moves the window moveamount pixels up.
  • window-move-down β€” moves the window moveamount pixels down.
  • window-move-right β€” moves the window moveamount pixels right.
  • window-move-left β€” moves the window moveamount pixels left.
  • window-move-up-big β€” moves the window 10 times moveamount pixels up.
  • window-move-down-big β€” moves the window 10 times moveamount pixels down.
  • window-move-right-big β€” moves the window 10 times moveamount pixels right.
  • window-move-left-big β€” moves the window 10 times moveamount pixels left.
  • window-resize-up β€” resizes the window moveamount pixels up.
  • window-resize-down β€” resizes the window moveamount pixels down.
  • window-resize-right β€” resizes the window moveamount pixels right.
  • window-resize-left β€” resizes the window moveamount pixels left.
  • window-resize-up-big β€” resizes the window 10 times moveamount pixels up.
  • window-resize-down-big β€” resizes the window 10 times moveamount pixels down.
  • window-resize-right-big β€” resizes the window 10 times moveamount pixels right.
  • window-resize-left-big β€” resizes the window 10 times moveamount pixels left.
  • window-snap-center β€” snaps the window to center.
  • window-snap-up β€” snaps the window to the top edge.
  • window-snap-down β€” snaps the window to the bottom edge.
  • window-snap-right β€” snaps the window to the right edge.
  • window-snap-left β€” snaps the window to the left edge.
  • window-snap-up-right β€” snaps the window to the top-right corner.
  • window-snap-up-left β€” snaps the window to the top-left corner.
  • window-snap-down-right β€” snaps the window to the bottom-right corner.
  • window-snap-down-left β€” snaps the window to the bottom-left corner.
  • pointer-move-up β€” moves the pointer moveamount pixels up.
  • pointer-move-down β€” moves the pointer moveamount pixels down.
  • pointer-move-right β€” moves the pointer moveamount pixels right.
  • pointer-move-left β€” moves the pointer moveamount pixels left.
  • pointer-move-up-big β€” moves the pointer 10 times moveamount pixels up.
  • pointer-move-down-big β€” moves the pointer 10 times moveamount pixels down.
  • pointer-move-right-big β€” moves the pointer 10 times moveamount pixels right.
  • pointer-move-left-big β€” moves the pointer 10 times moveamount pixels left.

πŸ“ FILES πŸ“

  • ~/.cwmrc β€” the default cwm(1) configuration file. this is the one, bestie πŸ’–

✨ EXAMPLES ✨

okay these are literally the example lines, so keep the code exactly as-is β€” no β€œimproving” the spacing, no cute little edits, none of that πŸ™ˆ

# 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) β€” yes, the main character. go read it, bestie 🫢

🌸 HISTORY 🌸

the cwmrc file format first appeared in OpenBSD 4.4. iconic behavior, honestly ✨


xoxo, this one’s from the Debian build πŸ’– β€” date stamp $Mdocdate$, page CWMRC(5) πŸŽ€

πŸ“¦ where this page comes from