Skip to content

Instantly share code, notes, and snippets.

@lvnilesh
Created February 20, 2025 03:50
Show Gist options
  • Save lvnilesh/37fed8e08bd9cef529a9d6fab05a6399 to your computer and use it in GitHub Desktop.
Save lvnilesh/37fed8e08bd9cef529a9d6fab05a6399 to your computer and use it in GitHub Desktop.
karabiner.json from m1 Mac
{
"global": { "show_profile_name_in_menu_bar": true },
"profiles": [
{
"complex_modifications": {
"rules": [
{
"description": "CAPS_LOCK to HYPER (SHIFT+COMMAND+OPTION+CONTROL) or ESCAPE (If Alone)",
"manipulators": [
{
"from": {
"key_code": "caps_lock",
"modifiers": {}
},
"to": [
{
"key_code": "left_shift",
"modifiers": ["left_command", "left_control", "left_option"]
}
],
"to_if_alone": [{ "key_code": "escape" }],
"type": "basic"
},
{
"description": "Avoid starting sysdiagnose with the built-in macOS shortcut cmd+shift+option+ctrl+,",
"from": {
"key_code": "comma",
"modifiers": { "mandatory": ["command", "shift", "option", "control"] }
},
"to": [],
"type": "basic"
},
{
"description": "Avoid starting sysdiagnose with the built-in macOS shortcut cmd+shift+option+ctrl+.",
"from": {
"key_code": "period",
"modifiers": { "mandatory": ["command", "shift", "option", "control"] }
},
"to": [],
"type": "basic"
},
{
"from": {
"description": "Avoid starting sysdiagnose with the built-in macOS shortcut cmd+shift+option+ctrl+/",
"key_code": "slash",
"modifiers": { "mandatory": ["command", "shift", "option", "control"] }
},
"to": [],
"type": "basic"
}
]
},
{
"description": "Toggle caps_lock by pressing left_shift then right_shift",
"manipulators": [
{
"from": {
"key_code": "left_shift",
"modifiers": {
"mandatory": ["right_shift"],
"optional": ["caps_lock"]
}
},
"to": [{ "key_code": "caps_lock" }],
"to_if_alone": [{ "key_code": "left_shift" }],
"type": "basic"
},
{
"from": {
"key_code": "right_shift",
"modifiers": {
"mandatory": ["left_shift"],
"optional": ["caps_lock"]
}
},
"to": [{ "key_code": "caps_lock" }],
"to_if_alone": [{ "key_code": "right_shift" }],
"type": "basic"
}
]
},
{
"description": "Shifts Move Forward and Backward by 1 word",
"manipulators": [
{
"from": { "key_code": "right_shift" },
"to": [{ "key_code": "right_shift" }],
"to_if_alone": [
{
"key_code": "right_arrow",
"modifiers": ["option"]
}
],
"type": "basic"
},
{
"from": { "key_code": "left_shift" },
"to": [{ "key_code": "left_shift" }],
"to_if_alone": [
{
"key_code": "left_arrow",
"modifiers": ["option"]
}
],
"type": "basic"
}
]
},
{
"description": "Double tap cmd closes apps",
"manipulators": [
{
"conditions": [
{
"name": "command-q",
"type": "variable_if",
"value": 1
}
],
"from": {
"key_code": "q",
"modifiers": { "mandatory": ["command"] }
},
"to": [
{
"key_code": "q",
"modifiers": "left_command"
}
],
"type": "basic"
},
{
"from": {
"key_code": "q",
"modifiers": { "mandatory": ["command"] }
},
"to": [
{
"set_variable": {
"name": "command-q",
"value": 1
}
}
],
"to_delayed_action": {
"to_if_canceled": [
{
"set_variable": {
"name": "command-q",
"value": 0
}
}
],
"to_if_invoked": [
{
"set_variable": {
"name": "command-q",
"value": 0
}
}
]
},
"type": "basic"
}
]
},
{
"description": "Hyper + SPACE : Toggle Alfred",
"manipulators": [
{
"from": {
"key_code": "spacebar",
"modifiers": { "mandatory": ["left_shift", "left_command", "left_control", "left_option"] }
},
"to": [
{
"key_code": "spacebar",
"modifiers": ["left_command"]
}
],
"type": "basic"
}
]
},
{
"description": "Open Screenshot.app with Print_Screen key",
"manipulators": [
{
"from": { "key_code": "print_screen" },
"to": [{ "shell_command": "open -a screenshot.app" }],
"type": "basic"
}
]
},
{
"description": "Hyper + i/j/k/l == vim directional Keys",
"manipulators": [
{
"from": {
"key_code": "k",
"modifiers": { "mandatory": ["left_shift", "left_command", "left_control", "left_option"] }
},
"to": [{ "key_code": "up_arrow" }],
"type": "basic"
},
{
"from": {
"key_code": "h",
"modifiers": { "mandatory": ["left_shift", "left_command", "left_control", "left_option"] }
},
"to": [{ "key_code": "left_arrow" }],
"type": "basic"
},
{
"from": {
"key_code": "j",
"modifiers": { "mandatory": ["left_shift", "left_command", "left_control", "left_option"] }
},
"to": [{ "key_code": "down_arrow" }],
"type": "basic"
},
{
"from": {
"key_code": "l",
"modifiers": { "mandatory": ["left_shift", "left_command", "left_control", "left_option"] }
},
"to": [{ "key_code": "right_arrow" }],
"type": "basic"
},
{
"from": {
"key_code": "semicolon",
"modifiers": { "mandatory": ["left_shift", "left_command", "left_control", "left_option"] }
},
"to": [
{
"key_code": "right_arrow",
"modifiers": ["left_command"]
}
],
"type": "basic"
}
]
},
{
"description": "o Launcher",
"manipulators": [
{
"conditions": [
{
"name": "launcher_mode_v4",
"type": "variable_if",
"value": 1
}
],
"from": {
"key_code": "n",
"modifiers": { "mandatory": [] }
},
"to": [{ "shell_command": "open -a 'notion.app'" }],
"type": "basic"
},
{
"from": {
"modifiers": { "mandatory": [] },
"simultaneous": [
{ "key_code": "o" },
{ "key_code": "n" }
],
"simultaneous_options": {
"key_down_order": "strict",
"key_up_order": "strict_inverse",
"to_after_key_up": [
{
"set_variable": {
"name": "launcher_mode_v4",
"value": 0
}
}
]
}
},
"parameters": { "basic.simultaneous_threshold_milliseconds": 500 },
"to": [
{
"set_variable": {
"name": "launcher_mode_v4",
"value": 1
}
},
{ "shell_command": "open -a 'notion.app'" }
],
"type": "basic"
},
{
"conditions": [
{
"name": "launcher_mode_v4",
"type": "variable_if",
"value": 1
}
],
"from": {
"key_code": "m",
"modifiers": { "mandatory": [] }
},
"to": [{ "shell_command": "open -a 'mail.app'" }],
"type": "basic"
},
{
"from": {
"modifiers": { "mandatory": [] },
"simultaneous": [
{ "key_code": "o" },
{ "key_code": "m" }
],
"simultaneous_options": {
"key_down_order": "strict",
"key_up_order": "strict_inverse",
"to_after_key_up": [
{
"set_variable": {
"name": "launcher_mode_v4",
"value": 0
}
}
]
}
},
"parameters": { "basic.simultaneous_threshold_milliseconds": 500 },
"to": [
{
"set_variable": {
"name": "launcher_mode_v4",
"value": 1
}
},
{ "shell_command": "open -a 'mail.app'" }
],
"type": "basic"
},
{
"conditions": [
{
"name": "launcher_mode_v4",
"type": "variable_if",
"value": 1
}
],
"from": {
"key_code": "s",
"modifiers": { "mandatory": [] }
},
"to": [{ "shell_command": "open -a 'Brave Browser Beta.app'" }],
"type": "basic"
},
{
"from": {
"modifiers": { "mandatory": [] },
"simultaneous": [
{ "key_code": "o" },
{ "key_code": "s" }
],
"simultaneous_options": {
"key_down_order": "strict",
"key_up_order": "strict_inverse",
"to_after_key_up": [
{
"set_variable": {
"name": "launcher_mode_v4",
"value": 0
}
}
]
}
},
"parameters": { "basic.simultaneous_threshold_milliseconds": 500 },
"to": [
{
"set_variable": {
"name": "launcher_mode_v4",
"value": 1
}
},
{ "shell_command": "open -a 'spotify.app'" }
],
"type": "basic"
},
{
"conditions": [
{
"name": "launcher_mode_v4",
"type": "variable_if",
"value": 1
}
],
"from": {
"key_code": "b",
"modifiers": { "mandatory": [] }
},
"to": [{ "shell_command": "open -a 'Brave Browser Beta.app'" }],
"type": "basic"
},
{
"from": {
"modifiers": { "mandatory": [] },
"simultaneous": [
{ "key_code": "o" },
{ "key_code": "b" }
],
"simultaneous_options": {
"key_down_order": "strict",
"key_up_order": "strict_inverse",
"to_after_key_up": [
{
"set_variable": {
"name": "launcher_mode_v4",
"value": 0
}
}
]
}
},
"parameters": { "basic.simultaneous_threshold_milliseconds": 500 },
"to": [
{
"set_variable": {
"name": "launcher_mode_v4",
"value": 1
}
},
{ "shell_command": "open -a 'Brave Browser Beta.app'" }
],
"type": "basic"
},
{
"conditions": [
{
"name": "launcher_mode_v4",
"type": "variable_if",
"value": 1
}
],
"from": {
"key_code": "a",
"modifiers": { "mandatory": [] }
},
"to": [{ "shell_command": "open -a 'Activity Monitor.app'" }],
"type": "basic"
},
{
"from": {
"modifiers": { "mandatory": [] },
"simultaneous": [
{ "key_code": "o" },
{ "key_code": "a" }
],
"simultaneous_options": {
"key_down_order": "strict",
"key_up_order": "strict_inverse",
"to_after_key_up": [
{
"set_variable": {
"name": "launcher_mode_v4",
"value": 0
}
}
]
}
},
"parameters": { "basic.simultaneous_threshold_milliseconds": 500 },
"to": [
{
"set_variable": {
"name": "launcher_mode_v4",
"value": 1
}
},
{ "shell_command": "open -a 'Activity Monitor.app'" }
],
"type": "basic"
},
{
"conditions": [
{
"name": "launcher_mode_v4",
"type": "variable_if",
"value": 1
}
],
"from": {
"key_code": "c",
"modifiers": { "mandatory": [] }
},
"to": [{ "shell_command": "open -a 'Visual Studio Code.app'" }],
"type": "basic"
},
{
"from": {
"modifiers": { "mandatory": [] },
"simultaneous": [
{ "key_code": "o" },
{ "key_code": "c" }
],
"simultaneous_options": {
"key_down_order": "strict",
"key_up_order": "strict_inverse",
"to_after_key_up": [
{
"set_variable": {
"name": "launcher_mode_v4",
"value": 0
}
}
]
}
},
"parameters": { "basic.simultaneous_threshold_milliseconds": 500 },
"to": [
{
"set_variable": {
"name": "launcher_mode_v4",
"value": 1
}
},
{ "shell_command": "open -a 'Visual Studio Code.app'" }
],
"type": "basic"
},
{
"conditions": [
{
"name": "launcher_mode_v4",
"type": "variable_if",
"value": 1
}
],
"from": {
"key_code": "i",
"modifiers": { "mandatory": [] }
},
"to": [{ "shell_command": "open -a 'iTerm.app'" }],
"type": "basic"
},
{
"from": {
"modifiers": { "mandatory": [] },
"simultaneous": [
{ "key_code": "o" },
{ "key_code": "i" }
],
"simultaneous_options": {
"key_down_order": "strict",
"key_up_order": "strict_inverse",
"to_after_key_up": [
{
"set_variable": {
"name": "launcher_mode_v4",
"value": 0
}
}
]
}
},
"parameters": { "basic.simultaneous_threshold_milliseconds": 500 },
"to": [
{
"set_variable": {
"name": "launcher_mode_v4",
"value": 1
}
},
{ "shell_command": "open -a 'iTerm.app'" }
],
"type": "basic"
}
]
}
]
},
"devices": [
{
"identifiers": {
"is_keyboard": true,
"is_pointing_device": true,
"product_id": 45091,
"vendor_id": 1133
},
"manipulate_caps_lock_led": false
},
{
"identifiers": {
"is_keyboard": true,
"is_pointing_device": true,
"product_id": 45921,
"vendor_id": 1133
},
"ignore": false,
"manipulate_caps_lock_led": false
}
],
"fn_function_keys": [
{
"from": { "key_code": "f3" },
"to": [{ "key_code": "mission_control" }]
},
{
"from": { "key_code": "f4" },
"to": [{ "key_code": "launchpad" }]
},
{
"from": { "key_code": "f5" },
"to": [{ "key_code": "illumination_decrement" }]
},
{
"from": { "key_code": "f6" },
"to": [{ "key_code": "illumination_increment" }]
}
],
"name": "Nilesh",
"selected": true,
"virtual_hid_keyboard": {
"country_code": 0,
"keyboard_type_v2": "ansi"
}
}
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment