From Gentoo Wiki
Jump to:navigation Jump to:search
This page contains changes which are not marked for translation.

bspwm is a lightweight, tiling, minimalist window manager written in C, which organizes its windows as nodes of a binary tree. Its installed size is less than 600 KB (even with the examples USE flag set). 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:

root #emerge --ask x11-misc/sxhkd


If bspwm was installed with the examples USE flag enabled, proper configuration is necessary.

First create the necessary directories that will hold the configuration files. Since bspwm does not manage keyboard or pointer inputs, it utilizes x11-misc/sxhkd (Simple X hotkey daemon) for this purpose. Consequently, we will need a configuration file for x11-misc/sxhkd, as it will house all of your key bindings.

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

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

user $cp -v /usr/share/doc/bspwm-0.9.10/examples/bspwmrc.* ~/.config/bspwm/
user $cp -v /usr/share/doc/bspwm-0.9.10/examples/sxhkdrc.* ~/.config/sxhkd/

If the configuration files are compressed, extract them using the applicable command for the compression format. For instance, if the files are compressed using zstd (.zst files), use the command:

user $zstd -vd ~/.config/bspwm/bspwmrc.zst
user $zstd -vd ~/.config/sxhkd/sxhkdrc.zst

The compressed files can then be removed:

user $rm -v ~/.config/bspwm/bspwm/bspwm.zst
user $rm -v ~/.config/sxhkd/sxhkdrc.zst

Adapt the above commands for the particular compression format used by Portage.

Ensure that the configuration file is executable. If it is not, one must make it executable by running the command chmod +x ~/.config/bspwm/bspwmrc.

Autostart programs

If there are specific programs that need to be started after logging in on the workstation, such as net-misc/dropbox and media-gfx/feh, one can achieve this by starting them in the bspwm configuration file:

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

Hide/Show windows

Some programs may have tray icons, and users may wish to replicate the minimize behavior (referred to as hide in the bspwm environment). This can be achieved by configuring a keyboard shortcut. It is important to note that when restoring these hidden windows, they will reappear on the same monitor where they were initially hidden.

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


A dynamic menu designed for X initially developed for dwm. Primarily focused on launching programs, but it can also be configured to perform other tasks.

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

st is an extremely minimal terminal emulator developed by the developers of dmenu.

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

urxvt 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
wide-glyphs Enable support for wide glyphs, required for certain symbol/icon fonts to display correctly. Note that this feature is *unofficial* and has been observed to cause stability issues for some users.
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 a 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