bspwm: Binary Space Partitioning Window Manager

Share your own howto's etc. Not for support questions!

bspwm: Binary Space Partitioning Window Manager

Postby Head_on_a_Stick » 2016-03-27 13:10

bspwm is a hybrid tiling window manager that represents windows as the leaves of a full binary tree.

Image
https://github.com/baskerville/bspwm

It uses XCB rather than Xlib and this makes it blazingly fast, even for a tiler.

It is designed to automate window handling and maximise the use of screen real estate and is controlled through keybindings, the mouse (it has better mouse support than most tilers) and the `bspc` command.

Much like Openbox, bspwm does not include a panel and I have found that it plays very nicely with tint2 thanks to full EWMH compliance.

Installation (manual)

Unfortunately, bspwm is not available in the Debian repositories and so must be installed from source.

First, install all of the dependencies:
Code: Select all
sudo apt install git gcc make xcb libxcb-util0-dev libxcb-ewmh-dev libxcb-randr0-dev libxcb-icccm4-dev libxcb-keysyms1-dev libxcb-xinerama0-dev libasound2-dev libxcb-xtest0-dev

Then clone the repositories:
Code: Select all
git clone https://github.com/baskerville/bspwm.git
git clone https://github.com/baskerville/sxhkd.git
git clone https://github.com/baskerville/xdo

Then build the packages:
Code: Select all
cd sxhkd && make && sudo make install
cd ../xdo && make && sudo make install
cd ../bspwm && make && sudo make install

There are only four executables (bspwm, bspc, sxhkd & xdo) and they are all placed in /usr/local/bin

Custom Repository

bspwm 0.9.1
sxhkd 0.5.6
xdo 0.5.2

To add the repository to your sources, use:
Code: Select all
sudo tee /etc/apt/sourceslist.d/HoaS.list <<< 'deb http://download.opensuse.org/repositories/home:/Head_on_a_Stick:/bspwm/Debian_8.0/ /'

This creates a file at /etc/apt/sources.list.d/HoaS.list with the repository line, simply delete this file if you ever want to remove the repository.

Then update the APT package database:
Code: Select all
sudo apt update

Then install the packages:
Code: Select all
sudo apt install bspwm sxhkd xdo

I will update the packages as upstream make the releases and these should be delivered as part of the regular `apt update && apt upgrade` routine.

Configuration

Copy over the configuration files:
Code: Select all
mkdir -p ~/.config/{bspwm,sxhkd}
cp /usr/share/doc/bspwm/examples/bspwmrc ~/.config/bspwm
cp /usr/share/doc/bspwm/examples/sxhkdrc ~/.config/sxhkd

~/.config/sxhkd/sxhkdrc controls the keybindings and ~/.config/bspwm/bspwmrc contains the general configuration.

Modify these to your tastes according to bspwm(1) and sxhkd(1)

A list of all the variables that can be used in bspwmrc can be found in the "Settings" section of https://github.com/baskerville/bspwm

The keybinds are all listed clearly in sxhkdrc and the syntax is very simple.

The default configuration starts urxvt with <Win>+<Return> and starts dmenu with <Win>+<Spacebar>

Tint2 and any other desired autostart programs such as volti & xfce4-power-manager can be added to ~/.config/bspwm/bspwmrc

Here is an example file:
Code: Select all
# ~/.config/bspwm/bspwmrc
#! /bin/sh

bspc config border_width        1
bspc config window_gap          0

bspc config split_ratio         0.5
bspc config borderless_monocle  true
bspc config gapless_monocle     true
bspc config focus_by_distance   true

bspc monitor -d I II III

bspc rule -a Gimp state=floating follow=on
bspc rule -a Mplayer2 state=floating
bspc rule -a Lxappearance state=floating
bspc rule -a Kupfer.py focus=on
bspc rule -a Screenkey manage=off

bspc config focused_border_color "#00aacc"
bspc config normal_border_color "#222222"
bspc config urgent_border_color "#ff0000"
bspc config focus_follows_pointer true

bspc config bottom_padding 30

xset s 300
xrdb ~/.Xdefaults
urxvtd -q -f -o
synclient tapbutton1=0 tapbutton2=0 tapbutton3=0 verttwofingerscroll=0 vertedgescroll=1 horizedgescroll=1 horizscrolldelta=10
sh ~/.fehbg
xfce4-power-manager
compton --backend glx --vsync opengl-mswc &
volti &
tint2 &
sxhkd &

The "bspc config bottom_padding" line clears a space for tint2 (30 pixels high and at the bottom in my set up).

Make sure that this line is present to start the keybind daemon:
Code: Select all
sxhkd &

If you have problems with slow window resizing when using the mouse (<Win>+<right-click> & drag), use:
Code: Select all
sxhkd -f 100 &


Integration

To select bspwm as your window manager, add it to /etc/alternatives as x-session-manager with a high priority:
Code: Select all
sudo update-alternatives --install /usr/bin/x-session-manager x-session-manager $(which bspwm) 90

This will start bspwm if "Default Xsession" is selected from LightDM or if `startx` is run from the console.

To reset the default window manager, use:
Code: Select all
sudo update-alternatives --config x-session-manager

To add tab-completion for the `bspc` command and it's options (very useful indeed), add the content of {bash,zsh}_completion to your shell configuration file:
Code: Select all
cat contrib/bash_completion >> ~/.bashrc # for BASH users
cat contrib/zsh_completion >> ~/.zshrc # for zsh users


There is no menu -- I use dmenu (via a keybind in sxhkdrc), which works very well.

Alternatively, a tint2 launcher could be used to start 9menu or similar.

There is also the possibility or using xfce4-panel instead of tint2 to take advantage of the menu plugin(s).
https://forums.bunsenlabs.org/viewtopic.php?pid=7005#p7005

This is the fastest and lightest window manager I have used so far:
Code: Select all
empty@BunsenLab ~ % sudo ps-mem|grep bspwm
432.0 KiB +  78.0 KiB = 510.0 KiB       bspwm
empty@BunsenLab ~ % sudo ps-mem|grep openbox
  3.0 MiB +   1.5 MiB =   4.5 MiB       openbox

Enjoy!
:)

Documentation

Code: Select all
man bspwm bspc sxhkd xdo lemonbar

https://github.com/smlb/dotfiles/wiki/Bspwm
https://github.com/windelicato/dotfiles/wiki/bspwm-for-dummies
https://wiki.archlinux.org/index.php/Bspwm
Last edited by Head_on_a_Stick on 2016-04-17 11:48, edited 5 times in total.
Don't break DebianHow to report bugs

SharpBang GNU/Linux — a pre-configured Openbox/Tint2 desktop running on Debian stable
User avatar
Head_on_a_Stick
 
Posts: 10607
Joined: 2014-06-01 17:46
Location: /dev/chair

Re: bspwm: Binary Space Partitioning Window Manager

Postby oswaldkelso » 2016-04-06 13:20

Have the Windows users and their ilk really taken such a hold on this forum. I find it quite disturbing that good clear howtos like this get no replys even if it's just to say xyz does this better or what killer features you could add ...

Not that bspwm is any good to me. I already run tbdtitw so I'm pretty much a stacking manager guy. Although I'm always trying to tweak it, it is pretty much set.

http://xahlee.info/linux/why_tiling_win ... sucks.html

fixed that :D

That said in all seriousness there needs to be more discussion on how desktops/interfaces work and how can they be made better rather than what wallpaper it's currently using.
Ash init durbatulûk, ash init gimbatul,
Ash init thrakatulûk agh burzum-ishi krimpatul.
User avatar
oswaldkelso
 
Posts: 1184
Joined: 2005-07-26 23:20
Location: UK

Re: bspwm: Binary Space Partitioning Window Manager

Postby Head_on_a_Stick » 2016-04-06 20:00

oswaldkelso wrote:http://xahlee.info/linux/why_tiling_window_manager_sucks.html

:lol:

One man's meat...
Don't break DebianHow to report bugs

SharpBang GNU/Linux — a pre-configured Openbox/Tint2 desktop running on Debian stable
User avatar
Head_on_a_Stick
 
Posts: 10607
Joined: 2014-06-01 17:46
Location: /dev/chair

Re: bspwm: Binary Space Partitioning Window Manager

Postby stevepusser » 2016-04-12 20:32

Have you thought of putting your packages into an openSUSE build service Debian repo? Just upload all your source files into one repo and let it go to work building and publishing them. It's free and quick to set up.

If you plan multiple projects there, it might be better to start out with this in a subproject instead of as your home project.
The MX Linux repositories: Backports galore! If we don't have something, just ask and we'll try--we like challenges. New packages: Chromium 78.0.3904.87, Hedgewars 1.0.0, PulseEffects 4.6.8, Telegram-desktop 1.8.15, Pale Moon 28.7.2, KeepassXC 2.5.0
User avatar
stevepusser
 
Posts: 11249
Joined: 2009-10-06 05:53

Re: bspwm: Binary Space Partitioning Window Manager

Postby Head_on_a_Stick » 2016-04-12 21:15

stevepusser wrote:Just upload all your source files into one repo and let it go to work building and publishing them.

It's really that easy?
:shock:

Thank you very much for the tip, I will try it out.
:)
Don't break DebianHow to report bugs

SharpBang GNU/Linux — a pre-configured Openbox/Tint2 desktop running on Debian stable
User avatar
Head_on_a_Stick
 
Posts: 10607
Joined: 2014-06-01 17:46
Location: /dev/chair

Re: bspwm: Binary Space Partitioning Window Manager

Postby stevepusser » 2016-04-12 21:54

Yes, you just go here:

https://build.opensuse.org/

Create an account, decide whether you want to make bspwm a home project or a subproject (either will work, and make sure to use "bspwm" as the package name if that's what they install), then create packages in the web interface and upload your three source files for each package from your local files. You can upload them in any order, but you'll get build errors if any are needed as build-depends until the build-deps are finished and appear in the repo.

Everything in one project or subproject goes into one repo, so if you want to keep packages separate, they'll have to be in a separate subproject.
The MX Linux repositories: Backports galore! If we don't have something, just ask and we'll try--we like challenges. New packages: Chromium 78.0.3904.87, Hedgewars 1.0.0, PulseEffects 4.6.8, Telegram-desktop 1.8.15, Pale Moon 28.7.2, KeepassXC 2.5.0
User avatar
stevepusser
 
Posts: 11249
Joined: 2009-10-06 05:53

Re: bspwm: Binary Space Partitioning Window Manager

Postby Head_on_a_Stick » 2016-04-13 18:00

Brilliant, thank you very much!
Don't break DebianHow to report bugs

SharpBang GNU/Linux — a pre-configured Openbox/Tint2 desktop running on Debian stable
User avatar
Head_on_a_Stick
 
Posts: 10607
Joined: 2014-06-01 17:46
Location: /dev/chair

Re: bspwm: Binary Space Partitioning Window Manager

Postby Head_on_a_Stick » 2016-04-15 20:45

Last edited by Head_on_a_Stick on 2016-04-15 21:04, edited 1 time in total.
Don't break DebianHow to report bugs

SharpBang GNU/Linux — a pre-configured Openbox/Tint2 desktop running on Debian stable
User avatar
Head_on_a_Stick
 
Posts: 10607
Joined: 2014-06-01 17:46
Location: /dev/chair

Re: bspwm: Binary Space Partitioning Window Manager

Postby stevepusser » 2016-04-15 21:01

It would probably be better to show the download link, which shows how to add the repo and how to add your repo key.

https://software.opensuse.org/download. ... kage=bspwm
The MX Linux repositories: Backports galore! If we don't have something, just ask and we'll try--we like challenges. New packages: Chromium 78.0.3904.87, Hedgewars 1.0.0, PulseEffects 4.6.8, Telegram-desktop 1.8.15, Pale Moon 28.7.2, KeepassXC 2.5.0
User avatar
stevepusser
 
Posts: 11249
Joined: 2009-10-06 05:53

Re: bspwm: Binary Space Partitioning Window Manager

Postby Head_on_a_Stick » 2016-04-15 21:04

Yes, thank you again :)

Changed.
Don't break DebianHow to report bugs

SharpBang GNU/Linux — a pre-configured Openbox/Tint2 desktop running on Debian stable
User avatar
Head_on_a_Stick
 
Posts: 10607
Joined: 2014-06-01 17:46
Location: /dev/chair

Re: bspwm: Binary Space Partitioning Window Manager

Postby stevepusser » 2016-04-15 21:08

But something's off; I don't see any 32-bit packages available, and I can see you had those builds enabled and they were successful. I don't think it would take that long for them to be published.
The MX Linux repositories: Backports galore! If we don't have something, just ask and we'll try--we like challenges. New packages: Chromium 78.0.3904.87, Hedgewars 1.0.0, PulseEffects 4.6.8, Telegram-desktop 1.8.15, Pale Moon 28.7.2, KeepassXC 2.5.0
User avatar
stevepusser
 
Posts: 11249
Joined: 2009-10-06 05:53

Re: bspwm: Binary Space Partitioning Window Manager

Postby Head_on_a_Stick » 2016-04-15 21:17

Mmmm... :?

I added the .dsc files plus the orig.tar.xz & debian.tar.xz all from my 64-bit system, do I need to add anything specific for an i386 build?

It's a little bit complicated: the 64-bit .debs were built in a QEMU VM with the 32-bit .debs being built in a systemd-nspawn container (created with debootstrap) within the VM; I don't think this would affect the results though.

I would have used pbuilder but I couldn't figure it out :(

EDIT: Nevermind, I specified "amd64" in the .dsc files :roll:
Don't break DebianHow to report bugs

SharpBang GNU/Linux — a pre-configured Openbox/Tint2 desktop running on Debian stable
User avatar
Head_on_a_Stick
 
Posts: 10607
Joined: 2014-06-01 17:46
Location: /dev/chair

Re: bspwm: Binary Space Partitioning Window Manager

Postby stevepusser » 2016-04-15 22:48

That'll do it. :!:

If I want to just regenerate source files for OBS, for example, I want to make a generic Debian package from an MX one by editing the debian/changelog file, I run
Code: Select all
debuild -S -uc -us


and upload those.

You can just delete (hover the cursor over the file name) the present .dsc and .debian.tar.xz files and upload the fixed ones to get it working right. It'll automatically rebuild.

The orig.tar.xz file should always be the same, so no need to reupload.
The MX Linux repositories: Backports galore! If we don't have something, just ask and we'll try--we like challenges. New packages: Chromium 78.0.3904.87, Hedgewars 1.0.0, PulseEffects 4.6.8, Telegram-desktop 1.8.15, Pale Moon 28.7.2, KeepassXC 2.5.0
User avatar
stevepusser
 
Posts: 11249
Joined: 2009-10-06 05:53

Re: bspwm: Binary Space Partitioning Window Manager

Postby Head_on_a_Stick » 2016-04-16 21:40

I have fixed all my n00bish errors and both 32-bit & 64-bit packages are now available for download from the repository.

Many thanks once more to stevepusser for his invaluable help -- you are a legend!
:)
Don't break DebianHow to report bugs

SharpBang GNU/Linux — a pre-configured Openbox/Tint2 desktop running on Debian stable
User avatar
Head_on_a_Stick
 
Posts: 10607
Joined: 2014-06-01 17:46
Location: /dev/chair

Re: bspwm: Binary Space Partitioning Window Manager

Postby stevepusser » 2016-04-17 00:44

Thanks for the compliments. I'd heard about OBS for several years, but never could figure it out. Maybe we could get some more people packaging and cut down on the plague of PPA additions we seem to be getting.

I also have a mini-multimedia repo for Jessie that shouldn't break anything. Since so much upstream depends on the "real" ffmpeg, I took that out of jessie-backports, reversioned it to bpo80.1 so it would build on OBS, and dropped it in (I think I needed a few build-deps first, not sure)
s
The problem with this versioning is that it might interfere with a smooth upgrade to Stretch if those packages are still stuck at the same version...not likely for ffmpeg, but it must be kept in mind.

Woah--look at the packages here! http://download.opensuse.org/repositori ... ebian_8.0/

It's scary--so many are those that I do for MX, it's almost like some kind of doppelganger is doing that.

Anyway, congratulations on your first repository! It'll probably be popular with Bunsen Lab techs...what is the nickname for those using that distro, anyway?
The MX Linux repositories: Backports galore! If we don't have something, just ask and we'll try--we like challenges. New packages: Chromium 78.0.3904.87, Hedgewars 1.0.0, PulseEffects 4.6.8, Telegram-desktop 1.8.15, Pale Moon 28.7.2, KeepassXC 2.5.0
User avatar
stevepusser
 
Posts: 11249
Joined: 2009-10-06 05:53


Return to Docs, Howtos, Tips & Tricks

Who is online

Users browsing this forum: No registered users and 2 guests

fashionable