how to: bspwm bspc rule for floating matplotlib figures

3

3

I have recently started using bspwm and I have been blown away by the improvement in my workflow. There is however one thing that has been bothering me:

I am writing data analysis scripts in python that use matplotlib for plotting. Every time a plot is drawn, my windows get rearranged because bspwm does its tiling magic. Normally, I would define a floating=True in the configuration file, however for this I need the name of the application. Something like this:

bspc rule -a matplotlib floating=on

Can somebody tell me, how can I properly address matplotlib figures?

P.S. Could somebody create a tag for bspwm?

Sasha

Posted 2015-07-11T00:43:51.160

Reputation: 133

Answers

7

To find the WM_CLASS (that is the name you must put in your bspwm rule) of any window use xprop. Execute

$xprop |awk '/WM_CLASS/{print $4}'

in a terminal, then click on the window you want to find the name of (in this case your matplotlib window) and you will get it printed to the terminal-

pinusc

Posted 2015-07-11T00:43:51.160

Reputation: 86

Thank you for your reply. In general, this answers the questions, but when I click on a matplotlib plot, I get ", as output. Any idea what might be causing this? – Sasha – 2015-10-20T08:05:49.893

I think the only possibility here is that matplotlib hasn't got a WM_CLASS. So, unless you can find in the matplotlib doc how to set one, (you'll maybe need to edit the source files) you can't set a bspc rule. – pinusc – 2015-11-05T21:46:41.943

0

matplotlib is getting WM_CLASS.  Here you can see a matplotlib window without any rules:

a matplotlib window without any rules

and here I made it floating:

floating

You need this rule in your $HOME/.config/bspwmrc.

bspc rule -a matplotlib state=floating

Here are some examples you can copy from: Abdullah's BSPWM Desktop Session.

Abdullah

Posted 2015-07-11T00:43:51.160

Reputation: 1