-
Notifications
You must be signed in to change notification settings - Fork 414
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Query to find active window on unfocused desktop not working #1474
Comments
Hm, yes, I recall As a workaround, if you need to get this information, you can use # "bspc query -N -n .window.active"
bspc wm -d |
jq '
.monitors[].dekstops[] |
# active nodes
first(
.focusedNodeId as $activeid |
.root |
.. |
select(.id? == $activeid)
) |
# that are windows
select(.client)
.id
'
# "bspc query -N -n '.window.!active' -d 4"
bspc query -T -d 4 |
jq '
.focusedNodeId as $activeid |
.root |
.. |
# windows
select(.client?)
.id |
# that are not the active node
select(. != $activeid)
'
# "bspc query -N -n '.window.active' -d 4"
bspc query -T -d 4 |
jq '
# the active node
first(
.focusedNodeId as $activeid |
.root |
.. |
select(.id? == $activeid)
) |
# only if it is a window
select(.client)
.id
' |
Thanks for the information |
This works but seems to be slowing my script down quite a bit. I'm not sure what exactly is slowing it down (whether it's the bspc call or the jq call). Is there any way of speeding it up? |
does changing the second active conditional in query.c:node_matches() to
give you expected output? removing that second conditional entirely would get focused included with active, which allows for update: this is wrong, and should be ignored. It does seem to give sane output on a single monitor setup, but totally incorrect on a multimonitor setup. |
Not sure what you mean by the second conditional in query.c:node_matches()? How should I modify
to test what you mean? |
Oh I see. I'm not sure. If I'm feeling adventurous I'll try to have a look later. I don't usually poke around in source code! |
I have 1 monitor with 9 desktops. I'm trying to write a script which will give me informatio about windows on the various desktops. I want to get the id/name of the window on each desktop that has focus on that desktop. Looking at the man page I thought it should be something like
bspc query -N -n .window.active -d 4
, for desktop 4 for example, and similar for all the desktops. This doesn't return anything.I should note that
bspc query -N -n .window -d 4
andbspc query -N -n .window.!active -d 4
both return the expected list of window IDs.bspc query -N -n .window -d 4
returns0x0680000E 0x04A00003 0x04800003
(as expected, all the windows I can see on desktop 4)bspc query -N -n .window.!active -d 4
returns0x0680000E 0x04800003
(as expected all the windows on desktop 4 apart from the one which has focusThe text was updated successfully, but these errors were encountered: