Difference between revisions of "2bwm"

From ArchWiki
Jump to: navigation, search
(Workspaces)
m (Starting 2bwm: rm red link)
(11 intermediate revisions by 2 users not shown)
Line 1: Line 1:
 
[[Category:Stacking WMs]]
 
[[Category:Stacking WMs]]
 
 
{{Warning|2bwm is still in alpha stage and should be used cautiously. At the moment, 2bwm is only for advanced users.}}
 
{{Warning|2bwm is still in alpha stage and should be used cautiously. At the moment, 2bwm is only for advanced users.}}
  
Line 13: Line 12:
 
=== Starting 2bwm ===
 
=== Starting 2bwm ===
  
2bwm generally starts from a script, either from [[startx]] or from a login manager such as [[xdm]].
+
2bwm generally starts from a script, either from [[startx]] or from a login manager such as [[XDM]].
  
 
If it starts from the console, a .xinitrc file is needed. Here's a complete example:
 
If it starts from the console, a .xinitrc file is needed. Here's a complete example:
Line 78: Line 77:
 
=== Workspaces ===
 
=== Workspaces ===
 
*0-9 – go to workspace n, 0-9.
 
*0-9 – go to workspace n, 0-9.
*Shift+0-9 – send to workspace nth.
+
*Shift+0-9 – send to workspace n.
 
*c or v – go to next/previous workspace.
 
*c or v – go to next/previous workspace.
 
*, or . – move window to previous/next monitor.
 
*, or . – move window to previous/next monitor.
  
 
===Mouse controls===
 
===Mouse controls===
By holding down the Super Key, you can perform these actions with the mouse:
+
By holding the Super Key, the mouse buttons act as follows:
 
*Button 1 on a window – move window
 
*Button 1 on a window – move window
 
*Button 3 on a window – resize window
 
*Button 3 on a window – resize window
*Button 3 + ctrl on the desktop – start the menu specified in config.h.
+
*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.
 
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.
Line 96: Line 95:
 
===Starting 2bwm over a terminal===
 
===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:
+
It is wise, if starting 2bwm like in the later .xinitrc, where we background the wm and ''exec'' a terminal emulator (such as [[rxvt-unicode]]), to immediately make the terminal that maintain the X session unkillable (Super+a by default). It will diminish the chance of killing this terminal and the X session at the same time.  
 
+
Putting a window in unkillable mode will also change the outer border colour and make it noticeable from other normal window. Beware that with some configurations, in urxvt, the outer border will not appear. A user reported the issue to be related to the following line in his ''.Xresources'' (or ''.Xdefaults'') file:
 
  URxvt.depth: 32
 
  URxvt.depth: 32
 +
Setting the depth to any value smaller than 32 fixes the issue. Note that you can also omit the line.
  
Setting the depth any value smaller than 32 fixes this issue and brings the outer border back to the terminal.
+
===Get the current workspace number using a script===
 
+
===Get the current workspace using a script===
+
 
The following command yields the current workspace:
 
The following command yields the current workspace:
 
  xprop -root _NET_CURRENT_DESKTOP | sed -e 's/_NET_CURRENT_DESKTOP(CARDINAL) = //'
 
  xprop -root _NET_CURRENT_DESKTOP | sed -e 's/_NET_CURRENT_DESKTOP(CARDINAL) = //'
  
===Easier to remember outer border colors===
+
===Easy to remember outer border colours===
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).
+
A simple trick to remember the meaning of the outer border colours would be by setting, for example, "fixed" to blue, "unkillable" to red, and "fixed + unkillable" to purple. The mix of blue and red create purple!
  
 
===Top left squares===
 
===Top left squares===
If you put <code>borders[0]</code> 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.
+
Setting <code>borders[0]</code> to a negative number will make the outer border turn into a square located in the top-left corner of the full-border. The colours set for the outer borders now stick to the square.
  
 
==Links==
 
==Links==
 
*[https://github.com/venam/2bwm 2bwm] - the GitHub repository for 2bwm
 
*[https://github.com/venam/2bwm 2bwm] - the GitHub repository for 2bwm

Revision as of 22:53, 11 June 2013

Warning: 2bwm is still in alpha stage and should be used cautiously. At the moment, 2bwm 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.

Installation

2bwmAUR can be installed from the AUR with or without using an AUR helper. Although the installation process can be automatic, if directly building from the AUR, it is highly recommended to read and edit the "config.h" file in the source directory.

Configuration

Starting 2bwm

2bwm generally starts from a script, either from startx or from a login manager such as XDM.

If it starts from the console, a .xinitrc file is needed. Here's a complete example:

 #!/bin/sh
 
 # 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. They have been removed because editing the config file was more convenient.

Using 2bwm

After the launch of 2bwm, a mouse cursor, a background, and a terminal will be the only thing on the screen (as specified in the .xinitrc). To open a terminal, using the default configuration, hit Super+Enter (Super Key aka Windows key/Mod4). Use the terminal as desired, for example to start a program with program_name &, however it is easier and more convenient to use a menu to launch programs, for instance dmenu or 9menu (available in the aur).

General commands

  • Super+Ctrl+q – exit 2bwm
  • Super+Ctrl+r – restart 2bwm
  • Super+w – start the menu
  • Super+Enter – start a terminal
  • Super+Arrows (+shift) – move the cursor (with shift fast).

Window controls

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

  • q – close window.
  • Tab or Shift+Tab – go to the 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).
  • r – raise or lower (toggles).
  • i – iconify (or hide) a window from the display.

Move, resize and teleport a window

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

  • x – maximize (toggles).
  • m – maximize vertically (toggles).
  • Shift+m – 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.

Workspaces

  • 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 the Super Key, the mouse buttons act as follows:

  • 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

It is wise, if starting 2bwm like in the later .xinitrc, where we background the wm and exec a terminal emulator (such as rxvt-unicode), to immediately make the terminal that maintain the X session unkillable (Super+a by default). It will diminish the chance of killing this terminal and the X session at the same time. Putting a window in unkillable mode will also change the outer border colour and make it noticeable from other normal window. Beware that with some configurations, in urxvt, the outer border will not appear. A user reported the issue to be related to the following line in his .Xresources (or .Xdefaults) file:

URxvt.depth: 32

Setting the depth to any value smaller than 32 fixes the issue. Note that you can also omit the line.

Get the current workspace number using a script

The following command yields the current workspace:

xprop -root _NET_CURRENT_DESKTOP | sed -e 's/_NET_CURRENT_DESKTOP(CARDINAL) = //'

Easy to remember outer border colours

A simple trick to remember the meaning of the outer border colours would be by setting, for example, "fixed" to blue, "unkillable" to red, and "fixed + unkillable" to purple. The mix of blue and red create purple!

Top left squares

Setting borders[0] to a negative number will make the outer border turn into a square located in the top-left corner of the full-border. The colours set for the outer borders now stick to the square.

Links

  • 2bwm - the GitHub repository for 2bwm