Skip to content

Help needed with yabai/skhd config #740

Answered by dominiklohmann
justsharan asked this question in Q&A
Discussion options

You must be logged in to vote

You can implement wraparound like this:

# cycle forwards
yabai -m window --focus next || yabai -m window --focus first

# cycle backwards
yabai -m window --focus prev || yabai -m window --focus last

Or, for a more complex solution that works a fair bit better:

# cycle forwards
yabai -m query --spaces --space \
  | jq -re ".index" \
  | xargs -I{} yabai -m query --windows --space {} \
  | jq -sre "add | map(select(.minimized != 1)) | sort_by(.display, .frame.y, .frame.x, .id) | reverse | nth(index(map(select(.focused == 1))) - 1).id" \
  | xargs -I{} yabai -m window --focus {}

# cycle backwards
yabai -m query --spaces --space \
  | jq -re ".index" \
  | xargs -I{} yabai -m query --window…

Replies: 1 comment 4 replies

Comment options

You must be logged in to vote
4 replies
@rockyzhang24
Comment options

@dominiklohmann
Comment options

@rockyzhang24
Comment options

@ajc5660
Comment options

Answer selected by dominiklohmann
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
4 participants
Converted from issue

This discussion was converted from issue #740 on December 11, 2020 13:30.