Open abelsromero opened 3 years ago
Document yabai cycleApp for v3 and v4: focus==1 is now has-focus==true
v3
cycleApp () {
local focus_id=$(yabai -m query --windows | jq "map(select(.app == \"$1\" and .focused == 1))[].id")
if [ -z "$focus_id" ]
then
open -a "/Applications/$2.app"
else
yabai -m window --focus "$(yabai -m query --windows | jq -re "[sort_by(.id, .frame) | reverse | .[] | select(.app == \"$1\") | .id] | nth(index($(yabai -m query --windows --window | jq -re ".id")) - 1)")"
fi
}
v4
cycleApp () {
local focus_id=$(yabai -m query --windows | jq "map(select(.app == \"$1\" and .\"has-focus\" == true))[].id")
if [ -z "$focus_id" ]
then
open -a "/Applications/$2.app"
else
yabai -m window --focus "$(yabai -m query --windows | jq -re "[sort_by(.id, .frame) | reverse | .[] | select(.app == \"$1\") | .id] | nth(index($(yabai -m query --windows --window | jq -re ".id")) - 1)")"
fi
}
install_to_path
should use custom path since .local/bin
is not available and we want a user local space.
Document and make modular for MacOs support.