Created
October 29, 2022 13:48
-
-
Save keturiosakys/16bac1951a3ae87915ce1415d92937d5 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
set appName to "WezTerm" | |
set yabaiQuery to "/opt/homebrew/bin/yabai -m query --windows | /opt/homebrew/bin/jq '.[] | select(.app==\"" & appName & "\") | .id'" | |
set windowId to do shell script yabaiQuery | |
if application appName is running then | |
tell application "System Events" | |
if visible of application process appName is true then | |
set visible of application process appName to false | |
else | |
set visible of application process appName to true | |
set yabaiCommand to "/opt/homebrew/bin/yabai -m window " & windowId & " --space mouse && /opt/homebrew/bin/yabai -m window --focus " & windowId | |
do shell script yabaiCommand | |
end if | |
end tell | |
else | |
tell application appName to activate | |
end if |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment