BSPWM Configuration
Categories:
4 minute read
A project I have been working on is to redesign my dotfiles to work on multiple machines running different distributions. Some solutions for BSPWM were required that have inspired this post. I will cover a few items, though nothing ground-breaking, that I hope will prove useful to someone.
Getting Started with BSPWM
Chances are you came here not looking to install BSPWM but extend your configuration. Though, if you are new to BSPWM here are basic instructions to install it on Arch Linux.
Now start BSPWM with something along the line of:
|
|
xrandr and Monitor Arrangement
I was making a call to xrandr in my bspwmrc file that needed to be made host dynamic. xrandr does not load a configuration file therefore I was able to create one for use within bspwmrc. The configuration file is a bash script that simply contains the xrandr command I wish to use on each machine. It is not tracked by my dotfiles repository.
The following excerpt from my bspwmrc file will source the xrandrrc file if it exists.
Desktop Configuration
The next solution required was for desktop layout across varying number of monitors. I ended up using an external script to make my call to bspc monitor -d … based on few predefined layouts for up 3 monitors. The complete script is as follows:
|
|
The script could be called from bspwmrc; in example:
|
|
Polybar
The final item I wanted to work on in my bspwmrc file was launching Polybar. This solution requires version 3.6.0 or higher of Polybar. I use relative paths with include-file in my configuration files which requires a recent version.
I split the polybar configuration file into included files for color, module, and global settings. They are included in bar specific configuration files for which there are 3: primary, secondary, and additional. Primary and secondary are for the first and second monitor and the additional bar configuration for any additional monitors.
An excerpt of a bar specific configuration file is listed below.
The Polybar launch script I use is listed below.
|
|
Diving Deeper
To get a better look at what I have done reference my dotfiles and scripts repositories.
https://github.com/enqack/.dotfiles
https://github.com/enqack/.scripts
BSPWM’s configuration file is located at:
https://github.com/enqack/.dotfiles/blob/master/stowed/bspwm/.config/bspwm/bspwmrc
Polybar’s configuration files are located at:
https://github.com/enqack/.dotfiles/tree/master/stowed/polybar/.config/polybar
Polybar’s lauch script is located at:
https://github.com/enqack/.scripts/blob/master/polybar/launch.sh