Note: you need to add /Library/Application Support/org.pqrs/Karabiner-Elements/bin/karabiner_console_user_server
in System Settings
→ Privacy & Security
→ Accessibility
→ +
Last active
January 9, 2024 14:30
-
-
Save devnoname120/760425defb9ba6c373b7ed43128f378f to your computer and use it in GitHub Desktop.
Karabiner-Elements — Microsoft Teams — Don't quit when pressing cmd-w on main window
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
{ | |
"author": "devnoname120 (https://github.com/devnoname120)", | |
"description": "Microsoft Teams — Don't quit when pressing cmd-w on main window", | |
"manipulators": [ | |
{ | |
"conditions": [ | |
{ | |
"bundle_identifiers": [ | |
"^com.microsoft.teams2" | |
], | |
"type": "frontmost_application_if" | |
} | |
], | |
"from": { | |
"key_code": "w", | |
"modifiers": { | |
"mandatory": [ | |
"command" | |
] | |
} | |
}, | |
"to": [ | |
{ | |
"shell_command": "if /opt/homebrew/bin/yabai -m query --windows --window | /opt/homebrew/bin/jq --exit-status -r '.title | test(\"^(Chat|Calendar|Activity|Teams and Channels|Tasks by Planner and To Do|SRG SpecialNumbers|OneDrive|Apps) \\\\|\")'; then /usr/bin/osascript -e 'tell application \"System Events\" to keystroke \"h\" using command down'; else /usr/bin/osascript -e 'tell application \"System Events\" to keystroke \"w\" using command down'; fi" | |
} | |
], | |
"type": "basic" | |
} | |
] | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment