Skip to content

Get master window using hyprctl? #6615

Answered by Siri-chan
akiross asked this question in Q&A
Discussion options

You must be logged in to vote

You can do a surprising amount with hyprctl -j and jq, for example, you can write something like this:

hyprctl clients -j | jq "[.[] | select (.workspace.id == $(hyprctl activewindow -j | jq .workspace.id))] | min_by(.at[0]) | .address"

You might have to do some more filtering to handle floating/pseudotiled windows, or change the min_by(.at[0]) to fit your master position (max_by will return the rightmost, and [1] will return a y-position), or some porting if you aren't using fish, but this should be a decent jumping off point.

Replies: 1 comment 1 reply

Comment options

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

Answer selected by akiross
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