Skip to content

Instantly share code, notes, and snippets.

@erchn
Created December 2, 2020 01:55
Show Gist options
  • Save erchn/c85f55412cd94d9526984b392878fad0 to your computer and use it in GitHub Desktop.
Save erchn/c85f55412cd94d9526984b392878fad0 to your computer and use it in GitHub Desktop.
{
"title": "Launch new Chrome or iTerm2 windows via keybindings",
"rules": [
{
"description": "caps lock - launches a new iTerm2 window with the default profile",
"manipulators": [
{
"from": {
"key_code": "caps_lock",
"modifiers": {
"mandatory": [
]
}
},
"to": [
{
"shell_command": "osascript -e 'tell app \"iTerm2\"' -e reopen -e activate -e end"
} ],
"type": "basic"
}
]
},
{
"description": "left option + 1 - launches a new Google Chrome window",
"manipulators": [
{
"from": {
"key_code": "1",
"modifiers": {
"mandatory": [
"left_option"
]
}
},
"to": [
{
"shell_command": "osascript -e 'tell app \"Google Chrome\"' -e 'activate' -e activate -e end"
}
],
"type": "basic"
}
]
},
{
"description": "left option + 2 - launches or activates Slack",
"manipulators": [
{
"from": {
"key_code": "2",
"modifiers": {
"mandatory": [
"left_option"
]
}
},
"to": [
{
"shell_command": "osascript -e 'tell app \"iTerm2\"' -e reopen -e activate -e end"
}
],
"type": "basic"
}
]
},
{
"description": "left option + 3 - launches or activates Slack",
"manipulators": [
{
"from": {
"key_code": "3",
"modifiers": {
"mandatory": [
"left_option"
]
}
},
"to": [
{
"shell_command": "osascript -e 'tell app \"Slack\"' -e 'reopen' -e activate -e end"
}
],
"type": "basic"
}
]
},
{
"description": "left option + 4 - launches or activates Zoom",
"manipulators": [
{
"from": {
"key_code": "4",
"modifiers": {
"mandatory": [
"left_option"
]
}
},
"to": [
{
"shell_command": "osascript -e 'tell app \"zoom.us\"' -e 'reopen' -e activate -e end"
}
],
"type": "basic"
}
]
},
{ "description": "command left arrow to command open bracket",
"manipulators": [
{
"from": {
"key_code": "left_arrow",
"modifiers": {
"mandatory": [
"command"
]
}
},
"to": {
"key_code": "open_bracket",
"modifiers": {
"mandatory": [
"command"
]
}
},
"type": "basic"
}
]
},
{ "description": "command right arrow to command close bracket",
"manipulators": [
{
"from": {
"key_code": "left_arrow",
"modifiers": {
"mandatory": [
"command"
]
}
},
"to": {
"key_code": "close_bracket",
"modifiers": {
"mandatory": [
"command"
]
}
},
"type": "basic"
}
]
}
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment