Skip to content

Excluding hidden windows with --match #7886

Answered by crazygolem
crazygolem asked this question in Q&A
Discussion options

You must be logged in to vote

For posterity, the following jq query returns all the visible windows as a match expression:

kitten @ ls \
| jq -r '
  [ .[] | select(.is_focused)
  | .tabs[] | select(.is_focused)
  | .groups[].windows[-1]
  | "id:" + (. | tostring)
  ] | join(" or ")
  '

The result can then be incorporated into the --match option for send-text:

"state:parent_focused and not state:self and ($tops)"

or for broadcast (the self window is automatically excluded by the kitten, and the previously visible window must now be additionally excluded if launched in an overlay):

"state:parent_focused and not state:overlay_parent and ($tops)"

Replies: 3 comments 2 replies

Comment options

You must be logged in to vote
1 reply
@crazygolem
Comment options

Comment options

You must be logged in to vote
1 reply
@crazygolem
Comment options

Comment options

You must be logged in to vote
0 replies
Answer selected by crazygolem
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants