Skip to content

Instantly share code, notes, and snippets.

@dstd
Last active November 30, 2020 22:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dstd/550636f152f8d1894e70e516b4d2590d to your computer and use it in GitHub Desktop.
Save dstd/550636f152f8d1894e70e516b4d2590d to your computer and use it in GitHub Desktop.
Input language switching mods for Karabiner
{
"title":"Input source change",
"rules": [
{
"description": "If pressed alone, CmdL for English, CmdR for Russian",
"manipulators": [
{
"from": {
"key_code": "left_command",
"modifiers": {"optional": ["any"]}
},
"to": {
"key_code": "left_command"
},
"to_if_alone": [
{"select_input_source": {"language": "en"}}
],
"type": "basic"
},
{
"from": {
"key_code": "right_command",
"modifiers": {"optional": ["any"]}
},
"to": {
"key_code": "right_command"
},
"to_if_alone": [
{"select_input_source": {"language": "ru"}}
],
"type": "basic"
}
]
},
{
"description": "Swap input source while CapsLock being held",
"manipulators": [
{
"conditions": [
{"type": "input_source_if", "input_sources": [{"language": "en"}]}
],
"from": {
"key_code": "caps_lock",
"modifiers": {"optional": ["any"]}
},
"to": [
{"select_input_source": {"language": "ru"}}
],
"to_after_key_up": [
{"select_input_source": {"language": "en"}}
],
"type": "basic"
},
{
"conditions": [
{"type": "input_source_if", "input_sources": [{"language": "ru"}]}
],
"from": {
"key_code": "caps_lock",
"modifiers": {"optional": ["any"]}
},
"to": [
{"select_input_source": {"language": "en"}}
],
"to_after_key_up": [
{"select_input_source": {"language": "ru"}}
],
"type": "basic"
}
]
}
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment