feat(karabiner): add modification to mute/unmute MS Teams with the keyboard

This commit is contained in:
Stefan Imhoff
2022-11-30 10:17:27 +01:00
parent 22d711d6a3
commit 88c1e1aa62
2 changed files with 65 additions and 0 deletions

View File

@@ -0,0 +1 @@
{"title":"Keychron K8 Microphone Button to Microsoft Teams Mute","rules":[{"description":"Focus Microsoft Teams Meeting Manager Window","manipulators":[{"from":{"modifiers":{"mandatory":["fn"]},"key_code":"spacebar"},"conditions":[{"type":"frontmost_application_unless","bundle_identifiers":["com.microsoft.teams"]}],"to":[{"shell_command":"if [ $(ps aux | grep -v grep | grep -ci \"Microsoft Teams.app/Contents/Frameworks/Microsoft Teams Helper.app\") -gt 0 ]; then osascript -e 'activate application id \"com.microsoft.teams\"' -e 'tell application \"System Events\" to keystroke \"m\" using {command down, shift down}'; fi","lazy":true,"repeat":true}],"type":"basic"}]},{"description":"Change Fn + Spacebar to Shift + Cmd + A","manipulators":[{"type":"basic","from":{"modifiers":{"mandatory":["fn"]},"key_code":"spacebar"},"conditions":[{"type":"frontmost_application_if","bundle_identifiers":["^com\\.microsoft\\.teams$"]}],"to":[{"key_code":"m","modifiers":["left_shift","left_gui"]}]}]}]}

View File

@@ -228,6 +228,70 @@
"type": "basic"
}
]
},
{
"description": "Focus Microsoft Teams Meeting Manager Window",
"manipulators": [
{
"conditions": [
{
"bundle_identifiers": [
"com.microsoft.teams"
],
"type": "frontmost_application_unless"
}
],
"from": {
"key_code": "spacebar",
"modifiers": {
"mandatory": [
"fn"
]
}
},
"to": [
{
"lazy": true,
"repeat": true,
"shell_command": "if [ $(ps aux | grep -v grep | grep -ci \"Microsoft Teams.app/Contents/Frameworks/Microsoft Teams Helper.app\") -gt 0 ]; then osascript -e 'activate application id \"com.microsoft.teams\"' -e 'tell application \"System Events\" to keystroke \"m\" using {command down, shift down}'; fi"
}
],
"type": "basic"
}
]
},
{
"description": "Change Fn + Spacebar to Shift + Cmd + A",
"manipulators": [
{
"conditions": [
{
"bundle_identifiers": [
"^com\\.microsoft\\.teams$"
],
"type": "frontmost_application_if"
}
],
"from": {
"key_code": "spacebar",
"modifiers": {
"mandatory": [
"fn"
]
}
},
"to": [
{
"key_code": "m",
"modifiers": [
"left_shift",
"left_gui"
]
}
],
"type": "basic"
}
]
}
]
},