A Brief Introduction
The linux philosophy promotes modular software. Linux itself is modular. This ensures plug and play ability, extensibility, and customization to your heart’s content. This also means that you can get bare-bones software and install only the bare essentials suited to your needs.
Bspwm or Binary Space Partition Window Manager, is based around the same philosophy. Bspwm is a minimalistic modern window manager that represents windows as the leaves of a full binary tree. Now due to the fact that there is not a lot of comprehensive documentation out there for bspwm (especially as compared to other window managers like i3), I decided to go ahead and make a (somewhat) practical guide myself. Forgive me if this particular entry in the series is too long.
sudo apt install bspwm
To run it, simple add the following line in your ~/.xsession file:
exec bspwm
Logout and log back in again, and boom! You are good to go. When you login, you will be greeted by a black screen. That is because bspwm doesn’t know how to draw the wallpaper yet. You will also notice that none of your typical window manager key bindings work. That is because bspwm requires a third party daemon for the same.
Logout from the current environment and login to either a tty, or any other environment, and let’s get started with the configuration so that we can make bspwm a bit usable.
SXHKD: Adding a keybinding daemon
An example configuration lies in the /usr/share/doc/bspwm/examples/bspwmrc file. Simply copy the bspwmrc file to the ~/.config/bspwm/ directory to get started. The default config file looks like this:
Adding a key binding daemon
Sxhkd, mentioned in the architecture given above, stands for Simple X Hot Key Daemon (And you thought herbstluftwm was hard to pronounce). It runs in the background and uses a very simple syntax to bind keys to commands. To get started with it simply run:
sudo apt install sxhkd
Sxhkd looks for a configuration file for initialization. You can create one at ~/.config/sxhkd/sxhkdrc. Let us look at how to add some basic key-bindings to get started with bspwm:
our sxhkdrc file:
The second rule makes sure that the moment we hit alt + Escape, our sxhkd reloads automatically, therefore making any further changes will not require us to manually kill the daemon and restart it ourselves.
To start the daemon simply add the following line in your bspwmrc:
sxhkd &
Now logout and login again. You will be greeted with a black screen, but the moment you hit alt + Return, you will get the terminal of your choice! Now this is all we need for further configuring our bspwm.