I'm having a little trouble getting the query i need from bspc. What I'm trying to do is send a notification when a window spawns on a desktop that is not active.
If I use bspc subscribe, i can test query -D -n $node.!active; but if i want to use the external rule script instead it becomes difficult. You can no longer check against the node, because it isn't placed yet (i think). Instead I've have been looping through bspc query -M and checking bspc query -D -d "${monitor}:focused" against the value of $desktop.
basically, is there a way to query for bspc wm -d | jq '.monitors[].focusedDesktopId'?/ is it worth adding a way to do this?
Yes, the node isn't managed yet. Within the external rules command, the intermediate consequence is given as $4. Inside this string you might extract a desktop selector (desktop=DESK_SEL). And then, you can simply do query -D -d "${DESK_SEL}.!focused". If DESK_SEL is empty, then the new window will appear inside the focused desktop and can therefore be discarded (unless you echo something like desktop=… within the same script…).
Thank you for this help and apologies for not trying a little more.
My problem was overlooking "DESK_SEL.focused" was true for "active" monitors, I really don't know why I didn't at try it
You shall use .active as of a94093b.
Most helpful comment
You shall use
.activeas of a94093b.