From ArchWiki
Revision as of 18:15, 11 May 2013 by Theconjuring (talk | contribs) (Created page with "Category:Stacking WMs {{Article summary start}} {{Article summary text|This wiki article is a guide on how to use and configure 2bwm.}} {{Article summary end}} {{Warning...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Template:Article summary start Template:Article summary text Template:Article summary end

Warning: 2bwm is still at alpha stage and should be used cautiously. 2bwm for now is only for advanced users.

2bwmAUR is a fast floating WM, with the particularity of having 2 borders, written over the XCB library and derived from mcwm written by Michael Cardell. In 2bwm everything is accessible from the keyboard but a pointing device can be used for move, resize and raise/lower. The name has recently changed from mcwm-beast to 2bwm.


You can get 2bwmAUR from the AUR with or without using an AUR helper. Although the installation will be automatic, it is highly recommended for you to read and modify the "config.h" file in the sources to your liking.


Starting 2bwm

Typically, 2bwm is started from a script, either run by startx or a login manager such as xdm.

If you start from the console, you need an .xinitrc file. Here's a complete example:

 # Set a nice background.
 xsetroot -solid grey20

 # Load resources.
 xrdb -load ~/.Xresources

 # Start window manager in the background. If it dies, X still lives.
 2bwm &

 # Start a terminal in the foreground. If this dies, X dies.
 exec urxvt

2bwm used to have startup options, but they have been removed.

Using 2bwm

Upon starting 2bwm, you will be presented with a mouse cursor, a background and a terminal (if you have specified so in your .xinitrc). To open a terminal (with the default configuration), use the key combination Super+Enter. (Super Key is also known as the Windows key, or Mod4.). You may run programs from the terminal using program_name &, but it is recommended for you to use a menu (dmenu, for instance) to launch programs.

Keyboard controls

Using the Super Key combined with one of the key combinations below while focused on a window:

  • arrows (+shift) – move the cursor (with shift fast).
  • r – raise or lower (toggles).
  • x – maximize (toggles).
  • m – maximize vertically (toggles).
  • shift+m (+ctrl) – maximize horizontally (toggles).
  • shift+H (+ctrl) – resize left (with ctrl slow).
  • shift+J (+ctrl) – resize down (with ctrl slow).
  • shift+K (+ctrl) – resize up (with ctrl slow).
  • shift+L (+ctrl) – resize right (with ctrl slow).
  • Home – grow keeping aspect.
  • End – shrink keeping aspect.
  • h (+ctrl) – move left (with ctrl slow)
  • j (+ctrl) – move down (with ctrl slow)
  • k (+ctrl) – move up (with ctrl slow)
  • l (+ctrl) – move right (with ctrl slow)
  • y – move to the upper left corner of monitor.
  • u – move to the upper right corner of monitor.
  • b – move to the lower left corner of monitor.
  • n – move to the lower right corner of monitor.
  • g – move to the center of monitor.
  • shift+y/shift+u/shift+b/shift+n – move to the left/right/bottom/top while maxvert/maxhor and half max horizontal/vertical.
  • Q – close window.
  • Return – start terminal
  • Tab or shift+Tab – go to next window in the current workspace window ring.
  • f – fix a window, making it visible on all workspaces (toggles).
  • a – make a window unkillable by Super+Q (toggles).
  • i – iconify (or hide) a window from the display.


  • 0-9 – go to workspace n, 0-9.
  • shift+0-9 – send to workspace n.
  • c or v – go to next/previous workspace.
  • , or . – move window to previous/next monitor.

Mouse controls

By holding down the Super Key, you can perform these actions with the mouse:

  • Button 1 on a window – move window
  • Button 3 on a window – resize window
  • Button 3 + ctrl on the desktop – start the menu specified in config.h.

Note that all functions activated from the keyboard work on the currently focused window regardless of the position of the mouse cursor. Of course, changing workspaces has nothing to do with the focused window.

You may change the keyboard mappings from config.h.

Tips & Tricks

Starting 2bwm over a terminal

If you fork 2bwm to background and exec a terminal emulator (such as rxvt-unicode), immediately put the terminal in unkillable mode (Super+A by default), so the X session doesn't crash by error. If you are using double borders, putting a window in unkillable mode will set the outer border's color to a significant one (that can be changed in the config.h). However, it's known that with some certain configurations, urxvt omits the outer border. To get past this issue, look into your .Xresources (or .Xdefaults) file for a line like the following:

URxvt.depth: 32

Setting the depth any value smaller than 32 fixes this issue and brings the outer border back to the terminal.

Get the current workspace using a script

The following command yields the current workspace:


Easier to remember outer border colors

You can use this trick to remember the meaning of outer border colors by setting e.g. "fixed" to blue, "unkillable" to red, and "fixed + unkillable" to purple (when you mix blue and red, you get purple).

Top left squares

If you put borders[0] negative, the outer border will turn into a square. The colors that you have set for the outer borders will still be visible in the square.


  • 2bwm - the GitHub repository for 2bwm