Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230

 

 

 

bspwm: Binary Space Partitioning Window Manager

Share your HowTo, Documentation, Tips and Tricks. Not for support questions!.
Post Reply
Message
Author
User avatar
Head_on_a_Stick
Posts: 14114
Joined: 2014-06-01 17:46
Location: London, England
Has thanked: 81 times
Been thanked: 132 times

bspwm: Binary Space Partitioning Window Manager

#1 Post by Head_on_a_Stick »

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 ... 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 ... or-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.
deadbang

User avatar
oswaldkelso
df -h | grep > 20TiB
df -h | grep > 20TiB
Posts: 1486
Joined: 2005-07-26 23:20
Location: UK
Has thanked: 1 time
Been thanked: 55 times

Re: bspwm: Binary Space Partitioning Window Manager

#2 Post by oswaldkelso »

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.
Free Software Matters
Ash init durbatulûk, ash init gimbatul,
Ash init thrakatulûk agh burzum-ishi krimpatul.
My oldest used PC: 1999 imac 333Mhz 256MB PPC abandoned by Debian

User avatar
Head_on_a_Stick
Posts: 14114
Joined: 2014-06-01 17:46
Location: London, England
Has thanked: 81 times
Been thanked: 132 times

Re: bspwm: Binary Space Partitioning Window Manager

#3 Post by Head_on_a_Stick »

:lol:

One man's meat...
deadbang

User avatar
stevepusser
Posts: 12930
Joined: 2009-10-06 05:53
Has thanked: 41 times
Been thanked: 71 times

Re: bspwm: Binary Space Partitioning Window Manager

#4 Post by stevepusser »

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.
MX Linux packager and developer

User avatar
Head_on_a_Stick
Posts: 14114
Joined: 2014-06-01 17:46
Location: London, England
Has thanked: 81 times
Been thanked: 132 times

Re: bspwm: Binary Space Partitioning Window Manager

#5 Post by Head_on_a_Stick »

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.
:)
deadbang

User avatar
stevepusser
Posts: 12930
Joined: 2009-10-06 05:53
Has thanked: 41 times
Been thanked: 71 times

Re: bspwm: Binary Space Partitioning Window Manager

#6 Post by stevepusser »

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.
MX Linux packager and developer

User avatar
Head_on_a_Stick
Posts: 14114
Joined: 2014-06-01 17:46
Location: London, England
Has thanked: 81 times
Been thanked: 132 times

Re: bspwm: Binary Space Partitioning Window Manager

#7 Post by Head_on_a_Stick »

Brilliant, thank you very much!
deadbang

User avatar
Head_on_a_Stick
Posts: 14114
Joined: 2014-06-01 17:46
Location: London, England
Has thanked: 81 times
Been thanked: 132 times

Re: bspwm: Binary Space Partitioning Window Manager

#8 Post by Head_on_a_Stick »

Last edited by Head_on_a_Stick on 2016-04-15 21:04, edited 1 time in total.
deadbang

User avatar
stevepusser
Posts: 12930
Joined: 2009-10-06 05:53
Has thanked: 41 times
Been thanked: 71 times

Re: bspwm: Binary Space Partitioning Window Manager

#9 Post by stevepusser »

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
MX Linux packager and developer

User avatar
Head_on_a_Stick
Posts: 14114
Joined: 2014-06-01 17:46
Location: London, England
Has thanked: 81 times
Been thanked: 132 times

Re: bspwm: Binary Space Partitioning Window Manager

#10 Post by Head_on_a_Stick »

Yes, thank you again :)

Changed.
deadbang

User avatar
stevepusser
Posts: 12930
Joined: 2009-10-06 05:53
Has thanked: 41 times
Been thanked: 71 times

Re: bspwm: Binary Space Partitioning Window Manager

#11 Post by stevepusser »

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.
MX Linux packager and developer

User avatar
Head_on_a_Stick
Posts: 14114
Joined: 2014-06-01 17:46
Location: London, England
Has thanked: 81 times
Been thanked: 132 times

Re: bspwm: Binary Space Partitioning Window Manager

#12 Post by Head_on_a_Stick »

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:
deadbang

User avatar
stevepusser
Posts: 12930
Joined: 2009-10-06 05:53
Has thanked: 41 times
Been thanked: 71 times

Re: bspwm: Binary Space Partitioning Window Manager

#13 Post by stevepusser »

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.
MX Linux packager and developer

User avatar
Head_on_a_Stick
Posts: 14114
Joined: 2014-06-01 17:46
Location: London, England
Has thanked: 81 times
Been thanked: 132 times

Re: bspwm: Binary Space Partitioning Window Manager

#14 Post by Head_on_a_Stick »

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!
:)
deadbang

User avatar
stevepusser
Posts: 12930
Joined: 2009-10-06 05:53
Has thanked: 41 times
Been thanked: 71 times

Re: bspwm: Binary Space Partitioning Window Manager

#15 Post by stevepusser »

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?
MX Linux packager and developer

Post Reply