Skip to content

Instantly share code, notes, and snippets.

@lvnilesh
Created September 23, 2023 05:59
Show Gist options
  • Save lvnilesh/bd9afd711acaa65a3e1c26f91be35b04 to your computer and use it in GitHub Desktop.
Save lvnilesh/bd9afd711acaa65a3e1c26f91be35b04 to your computer and use it in GitHub Desktop.
karabiner.json goes in ~/.config
{
"global": {
"ask_for_confirmation_before_quitting": true,
"check_for_updates_on_startup": true,
"show_in_menu_bar": true,
"show_profile_name_in_menu_bar": true,
"unsafe_ui": false
},
"profiles": [
{
"complex_modifications": {
"parameters": {
"basic.simultaneous_threshold_milliseconds": 50,
"basic.to_delayed_action_delay_milliseconds": 500,
"basic.to_if_alone_timeout_milliseconds": 1000,
"basic.to_if_held_down_threshold_milliseconds": 500,
"mouse_motion_to_scroll.speed": 100
},
"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": [
{
"disable_built_in_keyboard_if_exists": false,
"fn_function_keys": [],
"identifiers": {
"is_keyboard": true,
"is_pointing_device": true,
"product_id": 45091,
"vendor_id": 1133
},
"ignore": true,
"manipulate_caps_lock_led": false,
"simple_modifications": [],
"treat_as_built_in_keyboard": false
},
{
"disable_built_in_keyboard_if_exists": false,
"fn_function_keys": [],
"identifiers": {
"is_keyboard": false,
"is_pointing_device": true,
"product_id": 50475,
"vendor_id": 1133
},
"ignore": true,
"manipulate_caps_lock_led": false,
"simple_modifications": [],
"treat_as_built_in_keyboard": false
},
{
"disable_built_in_keyboard_if_exists": false,
"fn_function_keys": [],
"identifiers": {
"is_keyboard": true,
"is_pointing_device": true,
"product_id": 45921,
"vendor_id": 1133
},
"ignore": false,
"manipulate_caps_lock_led": false,
"simple_modifications": [],
"treat_as_built_in_keyboard": false
},
{
"disable_built_in_keyboard_if_exists": false,
"fn_function_keys": [],
"identifiers": {
"is_keyboard": true,
"is_pointing_device": false,
"product_id": 666,
"vendor_id": 76
},
"ignore": false,
"manipulate_caps_lock_led": true,
"simple_modifications": [],
"treat_as_built_in_keyboard": false
},
{
"disable_built_in_keyboard_if_exists": false,
"fn_function_keys": [],
"identifiers": {
"is_keyboard": false,
"is_pointing_device": true,
"product_id": 613,
"vendor_id": 76
},
"ignore": true,
"manipulate_caps_lock_led": false,
"simple_modifications": [],
"treat_as_built_in_keyboard": false
},
{
"disable_built_in_keyboard_if_exists": false,
"fn_function_keys": [],
"identifiers": {
"is_keyboard": true,
"is_pointing_device": false,
"product_id": 126,
"vendor_id": 5426
},
"ignore": false,
"manipulate_caps_lock_led": true,
"simple_modifications": [],
"treat_as_built_in_keyboard": false
},
{
"disable_built_in_keyboard_if_exists": false,
"fn_function_keys": [],
"identifiers": {
"is_keyboard": false,
"is_pointing_device": true,
"product_id": 126,
"vendor_id": 5426
},
"ignore": true,
"manipulate_caps_lock_led": false,
"simple_modifications": [],
"treat_as_built_in_keyboard": false
},
{
"disable_built_in_keyboard_if_exists": false,
"fn_function_keys": [],
"identifiers": {
"is_keyboard": true,
"is_pointing_device": false,
"product_id": 123,
"vendor_id": 5426
},
"ignore": false,
"manipulate_caps_lock_led": true,
"simple_modifications": [],
"treat_as_built_in_keyboard": false
},
{
"disable_built_in_keyboard_if_exists": false,
"fn_function_keys": [],
"identifiers": {
"is_keyboard": false,
"is_pointing_device": true,
"product_id": 123,
"vendor_id": 5426
},
"ignore": true,
"manipulate_caps_lock_led": false,
"simple_modifications": [],
"treat_as_built_in_keyboard": false
},
{
"disable_built_in_keyboard_if_exists": false,
"fn_function_keys": [],
"identifiers": {
"is_keyboard": true,
"is_pointing_device": false,
"product_id": 109,
"vendor_id": 9580
},
"ignore": false,
"manipulate_caps_lock_led": true,
"simple_modifications": [],
"treat_as_built_in_keyboard": false
}
],
"fn_function_keys": [
{
"from": {
"key_code": "f1"
},
"to": [
{
"consumer_key_code": "display_brightness_decrement"
}
]
},
{
"from": {
"key_code": "f2"
},
"to": [
{
"consumer_key_code": "display_brightness_increment"
}
]
},
{
"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"
}
]
},
{
"from": {
"key_code": "f7"
},
"to": [
{
"consumer_key_code": "rewind"
}
]
},
{
"from": {
"key_code": "f8"
},
"to": [
{
"consumer_key_code": "play_or_pause"
}
]
},
{
"from": {
"key_code": "f9"
},
"to": [
{
"consumer_key_code": "fast_forward"
}
]
},
{
"from": {
"key_code": "f10"
},
"to": [
{
"consumer_key_code": "mute"
}
]
},
{
"from": {
"key_code": "f11"
},
"to": [
{
"consumer_key_code": "volume_decrement"
}
]
},
{
"from": {
"key_code": "f12"
},
"to": [
{
"consumer_key_code": "volume_increment"
}
]
}
],
"name": "Nilesh",
"parameters": {
"delay_milliseconds_before_open_device": 1000
},
"selected": true,
"simple_modifications": [],
"virtual_hid_keyboard": {
"country_code": 0,
"indicate_sticky_modifier_keys_state": true,
"mouse_key_xy_scale": 100
}
}
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment