2bwm − A small and fast keyboard driven window manager with two borders.
2bwm 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.
Nota bene: It is highly recommended to check the config.h file at least once. 2bWM is configured at compile time and anything you might want to change is in the config.h file, from colors to keybinds.
With the the default configuration:
MOUSEMODKEY + mouse buttons:
• |
1 move |
|||
• |
3 resize window |
MOUSEMODKEY + CTRL + mouse buttons :
• |
3 starts the menu (you have to set the menu in the config file) |
MOUSEMODKEY + ALT + mouse buttons :
• |
3 next screen |
|||
• |
1 previous screen |
MODKEY + key :
• |
0−9 go to workspace n, 0-9. | ||
• |
shift+0−9 Move window to workspace. | ||
• |
Tab or shift+Tab go to next window in the current workspace window ring. | ||
• |
Q close/kill a window. | ||
• |
shift+J resize down. | ||
• |
shift+K resize up. | ||
• |
shift+L resize right. | ||
• |
shift+H resize left. | ||
• |
shift+ctrl+H resize slow left. | ||
• |
shift+ctrl+J resize slow down. | ||
• |
shift+ctrl+K resize slow up. | ||
• |
shift+ctrl+L resize slow right. | ||
• |
h move left. | ||
• |
j move down. | ||
• |
k move up. | ||
• |
l move right. | ||
• |
ctrl+h move left slow. | ||
• |
ctrl+j move down slow. | ||
• |
ctrl+k move up slow. | ||
• |
ctrl+l move right slow. | ||
• |
y move to upper left corner of monitor. | ||
• |
u move to upper right corner of monitor. | ||
• |
b move to lower left corner of monitor. | ||
• |
n move to lower right corner of monitor. | ||
• |
g move to the center of the monitor. | ||
• |
Home Grow keeping aspect. | ||
• |
End Shrink keeping aspect. | ||
• |
x maximize/full screen (toggles). | ||
• |
shift+x maximize/full screen overriding offsets (toggles). | ||
• |
m maximize vertically (toggles). | ||
• |
shift+m maximize horizontally (toggles). | ||
• |
shift+y/shift+u/shift+b/shift+n move to the left/right/bottom/top while maxvert/maxhor and half max horizontal/vertical | ||
• |
shift+ctrl+b/n fold or Unfold horizontally | ||
• |
shift+ctrl+y/u fold or Unfold vertically | ||
• |
. move window to next monitor/screen. | ||
• |
, move window to previous monitor. | ||
• |
r raise or lower (toggles). | ||
• |
v/c Go to next/previous workspace | ||
• |
shift+v/c move to next/previous workspace | ||
• |
i iconify (or hide) window from the display. | ||
• |
a Make a window unkillable (toggles). | ||
• |
t Make a window stay on top. | ||
• |
f fix window so it is visible on all workspaces (toggles). | ||
• |
arrows (+shift) Move the cursor (with shift fast). | ||
• |
w start the menu program (to be set in the config file) | ||
• |
ctr+q ctrl+r quit or restart 2bwm | ||
• |
space half the screen and centered | ||
• |
ctrl+(up/down/right) emulate click 1,2,3 (depends on xdotool(1)) |
Note that all functions activated from the keyboard work on the currently focused window regardless of the position of the mouse cursor.
You can change the keybinds and colors in the config.h file and then recompile and restart to see changes.
2bwm does not come with a bar, or panel. 2bwm will respect some EWMH hints such as _NET_WM_WINDOW_TYPE_DOCK. Thus, most panels should work. The followinds were tested:
Panels
• |
cairo-dock |
|||
• |
fbpanel |
|||
• |
hpanel |
|||
• |
lxpanel |
|||
• |
tint2 |
|||
• |
xfce4-panel |
Bars
• |
bar |
|||
• |
dzen2 |
If you set up a bar don’t forget to add the space at the bottom or at the top of the screen in the configs. Also, if you want to know the current workspace you can use ‘xprop -root _NET_CURRENT_DESKTOP| sed -e ’s/_NET_CURRENT_DESKTOP(CARDINAL) = //’‘
• |
SIGINT - SIGTERM |
Cleanup and exit (with the signal number as exit code)
• |
SIGHUP |
Cleanup and restart
0 on success anything else on error or on signal received.
2bwm obeys the $DISPLAY variable.
There is currently a race condition when switching worskpaces really fast. This may be due to the asynchronous nature of the X11 protocol. A fix was tried using locks without much luck (using atomic variables.)
If you experience problems with java GUI you can refer to http://awesome.naquadah.org/wiki/Problems_with_Java most probably adding _JAVA_AWT_WM_NONREPARENTING=1 to the environment variable will resolve the problem. (export _JAVA_AWT_WM_NONREPARENTING=1)
2bWM comes with the hidden(1) program. hidden(1) lists all the hiden windows so you can pipe it into a menu program such as 9menu(1).
hidden -c|xargs 9menu -popup -label Iconics -font "terminus12-10"
You might also be interested in the following shell function that might come in handy to give your terminal emulators good titles before hiding them.
# Set the title
and icon name of an xterm or clone.
function title
{
# icon name | |
echo -e ’\033]1;’$1’\007’ | |
# title | |
echo -e ’\033]2;’$1’\007’ |
}
Use it like this:
% title ’really descriptive title’
Typically the window manager is started from a script, either run by startx(1) or a login manager such as xdm(1).
If you start from the console, you need an .xinitrc file. Here’s a complete example:
#! /bin/sh
# Set nice
background.
xsetroot -bg
# Set nice pointer cursor.
xsetroot −cursor_name plus −fg white −bg
black
# 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
hidden(1) xdotool(1) 9menu(1) startx(1) xdm(1)
Venam | Patrick Louis <patrick at iotek do org>
Big thanks for the help of the following persons:
• |
Yrmt |
|||
• |
maxrp |
|||
• |
z3bra |
|||
• |
cicku |
|||
• |
tbck |
|||
• |
crshd |
|||
• |
anshin |
Thanks to the UnixHub/Nixers community for the support and ideas.
Thanks to Michael Cardell <[email protected]> for starting it all.