From Gentoo Wiki
Jump to:navigation Jump to:search

bspwm is a lightweight, tiling, minimalist window manager that is written in C and represents its windows as leaves on a binary tree. Its installed size is less than 600 KB (even with the examples USE flag enabled). It only responds to X events and messages it receives on a dedicated socket from a program included in its package, bspc.


USE flags

USE flags for x11-wm/bspwm Tiling window manager based on binary space partitioning

examples Install examples, usually source code


To install bspwm using Portage merely issue the command:

root #emerge --ask x11-wm/bspwm

sxhkd is used for keybindings and pointer bindings so one may wish to install it too with:

root #emerge --ask x11-misc/sxhkd


If you installed with examples local USE flag enabled, you have to configure bspwm properly.

First create the necessary directories that will hold your configurations. Because bspwm doesn't handle keyboard or pointer inputs, it's using x11-misc/sxhkd (Simple X hotkey daemon) to do so, therefore we'll need a config file for that as well because that's where all your key bindings will reside.

user $mkdir -vp ~/.config/bspwm ~/.config/sxhkd

Now copy the sample configuration files from /usr/share/doc/bspwm-0.9.9/examples/ and, if required, extract them:

user $cp -v /usr/share/doc/bspwm-0.9.9/examples/bspwmrc ~/.config/bspwm/
user $cp -v /usr/share/doc/bspwm-0.9.9/examples/sxhkdrc ~/.config/sxhkd/
The bspwmrc configuration file needs to be executable. Therefore, if it's not, you can chmod +x ~/.config/bspwm/bspwmrc.

Autostart programs

If you have certain programs that want to start after logging in on the workstation (i.e. net-misc/dropbox, media-gfx/feh) you can achieve that by simply adding them in the bspwm config file

FILE ~/.config/bspwm/bspwmrcbspwm configuration file
# autostart programs
feh --bg-scale ~/.config/my_wallpaper.png

Hide/Show windows

Some programs also have tray icons and one may want to mimic the Minimize behavior (hide in the bspwm world), you can achieve that by setting a keyboard shortcut. Note that when restoring them, they will spawn in the same Monitor that they were hidden, just so you don't go look for them in the other Desktops randomly...

FILE ~/.config/sxhkd/sxhkdrcsxhkd configuration file
# hide window
super + v
  bspc node -g hidden

# unhide window
super + shift + v
  bspc node {,$(bspc query -N -n .hidden | tail -n1)} -g hidden=off

Additional software


In order to launch whatever programs you desire

USE flags for x11-misc/dmenu a generic, highly customizable, and efficient menu for the X Window System

savedconfig Use this to restore your config from /etc/portage/savedconfig ${CATEGORY}/${PN}. Make sure your USE flags allow for appropriate dependencies
xinerama Add support for querying multi-monitor screen geometry through the Xinerama API

To assign a keyboard shortcut for launching dmenu:

FILE ~/.config/sxhkd/sxhkdrcsxhkd configuration file
# program launcher
super + @space

Terminal emulators

st aka suckless/simple terminal

If lightweight is how you roll, this might be of use

USE flags for x11-terms/st Simple terminal implementation for X

savedconfig Use this to restore your config from /etc/portage/savedconfig ${CATEGORY}/${PN}. Make sure your USE flags allow for appropriate dependencies

To install it, just issue the command:

root #emerge --ask x11-terms/st

To enable a keyboard shortcut for launching the terminal

FILE ~/.config/sxhkd/sxhkdrcsxhkd configuration file
# terminal emulator
super + Return

rxvt-unicode aka urxvt

This is another alternative, although it lacks full unicode support and you might have some issues with Powerline Fonts.

USE flags for x11-terms/rxvt-unicode rxvt clone with xft and unicode support

24-bit-color Enable 24-bit color support. Note that this feature is unofficial, may cause visual glitches due to the fact there is no termcap/terminfo definition for rxvt-unicode-24bit yet so it is necessary to use the one for 256 colours, visibly increases memory usage, and might slow urxvt down dramatically when more than six fonts are in use in a terminal instance.
256-color Enable 256 color support
blink Enable blinking text
fading-colors Enable colors fading when off focus
font-styles Enable support for bold and italic fonts
gdk-pixbuf Enable transparency support using x11-libs/gdk-pixbuf
iso14755 Enable ISO-14755 support
mousewheel Enable scrolling via mouse wheel or buttons 4 and 5
perl Enable perl script support. You can still disable this at runtime with -pe ""
startup-notification Enable application startup event feedback mechanism
unicode3 Use 21 instead of 16 bits to represent unicode characters
xft Build with support for XFT font renderer (x11-libs/libXft)

You can install it issuing the command:

root #emerge --ask x11-terms/rxvt-unicode


Locking your screen is always recommended in order to avoid unauthorized access to your Workstation

USE flags for x11-misc/i3lock Simple screen locker

You can install it by issuing the command:

root #emerge --ask x11-misc/i3lock

In order to assign a keyboard shortcut for locking your screen, you should update your configuration file

FILE ~/.config/sxhkd/sxhkdrcsxhkd configuration file
# lock the screen with dark background
super + q
  i3lock -c 000000

File managers


ranger is a console file manager with VI key bindings. It provides a minimalistic and nice curses interface with a view on the directory hierarchy. It ships with rifle, a file launcher that is good at automatically finding out which program to use for what file type.

You can install ranger via

root #emerge --ask app-misc/ranger

If you want to tune ranger with your own settings:

Start ranger and exit so that it creates the directory structure for its configuration files.

user $ranger
user $Q

Now copy the configuration files:

user $ranger --copy-config=all
creating: /home/user/.config/ranger/
creating: /home/user/.config/ranger/
creating: /home/user/.config/ranger/rc.conf
creating: /home/user/.config/ranger/
creating: /home/user/.config/ranger/

See also

External resources