In my bspwmrc file, I have the following line
bspec rule -a Gimp desktop=‘^8’ state=floating follow=on
This line is supposed to open Gimp in workspace/desktop 8 among other things. But Gimp opens in my current desktop, not desktop 8.
Looking at man bspc, the first entry after -a should be the <class_name>. Using xprop, the class_name for Gimp is Gimp-2.10. When I change the rule to use Gimp-2.10, then Gimp opens correctly in desktop 8.
I also tried using Gimp-* and Gimp* for class_name, to cater for subsequent gimp updates. That didn’t work. Gimp was back to opening in the current desktop.
I can leave Gimp-2.10 in the bspwmrc, but I would like to have the best of both worlds. How would I modify the class_name so that Gimp-2.10 and Gimp-2.11 open on desktop 8?
PS I am brand new to BSPWM and bspc
Thanks for responding, pebcak.
Changing ‘^8’ to ^8 in the rule line in question does not make the rule work with class_name of Gimp.
There are other rules, like one for firefox that uses ‘^2’ that works as expected. But that rule has the class_name correctly as firefox.
I really think the problem is down to a rule needing the exact class_name, as I haven’t found a way to partial match like Gimp*. I’m hoping there is a way to do that
Using an external_rules file is more flexible.
Check this out.
When I find some time, I could post my external_rules file as an example.
Edit: Here you are, although I am no expert and some mistakes might exist. Use after experimentation
## man bspc: external_rules_command
## Absolute path to the command used to retrieve rule consequences.
## The command will receive the following arguments:
## window ID, class, name, instance name, and intermediate consequences.
## The output of that command must have the following format:
## key1=value1 key2=value2 ...
## (the valid key/value pairs are given in the description of the rule command).
# Log for debugging
# echo -en "$winID\t$class\t$wname\t$instance\t$sequences\n" >> .cache/bspwm-session.log
case "$wname" in
*) if [ "$class" = "megasync" ]; then
# if the class name is "Qemu-system" or "Qemu-system-something", and the
# instance name is "qemu", apply `state=floating`
case $class in
if [ $(xprop -id $winID WM_WINDOW_ROLE | cut -d= -f2 | tr -d [[:punct:]]) = "browser" ] ; then
[ "$instance" = qemu ] && printf 'state=floating\n'