From 66b1d2678977c0eb1eddf12deab912e40149ece1 Mon Sep 17 00:00:00 2001 From: afonso Date: Mon, 21 Oct 2024 17:59:54 +0100 Subject: [PATCH] [karabiner] add karabiner elements config --- .config/karabiner/karabiner.json | 996 +++++++++++++++++++++++++++++++ 1 file changed, 996 insertions(+) create mode 100644 .config/karabiner/karabiner.json diff --git a/.config/karabiner/karabiner.json b/.config/karabiner/karabiner.json new file mode 100644 index 0000000..ccf0474 --- /dev/null +++ b/.config/karabiner/karabiner.json @@ -0,0 +1,996 @@ +{ + "global": { "show_in_menu_bar": false }, + "profiles": [ + { + "complex_modifications": { + "rules": [ + { + "description": "Tmux Prefix Mode [caps_lock as trigger key] (rev 2)", + "manipulators": [ + { + "conditions": [ + { + "bundle_identifiers": [ + "^io\\.alacritty$", + "^org\\.alacritty$", + "net.kovidgoyal.kitty", + "com.github.wez.wezterm" + ], + "type": "frontmost_application_if" + } + ], + "from": { + "key_code": "caps_lock", + "modifiers": { "optional": ["shift"] } + }, + "to": [ + { + "set_variable": { + "name": "tmux_prefix_mode", + "value": 1 + } + } + ], + "to_after_key_up": [ + { + "set_variable": { + "name": "tmux_prefix_mode", + "value": 0 + } + } + ], + "to_if_alone": [ + { + "hold_down_milliseconds": 200, + "key_code": "escape" + } + ], + "type": "basic" + } + ] + }, + { + "description": "Tmux Prefix Mode [ ctrl+B as prefix ]", + "manipulators": [ + { + "conditions": [ + { + "name": "tmux_prefix_mode", + "type": "variable_if", + "value": 1 + } + ], + "from": { + "key_code": "a", + "modifiers": { "optional": ["caps_lock", "shift"] } + }, + "to": [ + { + "key_code": "b", + "modifiers": ["left_control"] + }, + { "key_code": "a" } + ], + "type": "basic" + }, + { + "conditions": [ + { + "name": "tmux_prefix_mode", + "type": "variable_if", + "value": 1 + } + ], + "from": { + "key_code": "b", + "modifiers": { "optional": ["caps_lock", "shift"] } + }, + "to": [ + { + "key_code": "b", + "modifiers": ["left_control"] + }, + { "key_code": "b" } + ], + "type": "basic" + }, + { + "conditions": [ + { + "name": "tmux_prefix_mode", + "type": "variable_if", + "value": 1 + } + ], + "from": { + "key_code": "c", + "modifiers": { "optional": ["caps_lock", "shift"] } + }, + "to": [ + { + "key_code": "b", + "modifiers": ["left_control"] + }, + { "key_code": "c" } + ], + "type": "basic" + }, + { + "conditions": [ + { + "name": "tmux_prefix_mode", + "type": "variable_if", + "value": 1 + } + ], + "from": { + "key_code": "d", + "modifiers": { "optional": ["caps_lock", "shift"] } + }, + "to": [ + { + "key_code": "b", + "modifiers": ["left_control"] + }, + { "key_code": "d" } + ], + "type": "basic" + }, + { + "conditions": [ + { + "name": "tmux_prefix_mode", + "type": "variable_if", + "value": 1 + } + ], + "from": { + "key_code": "e", + "modifiers": { "optional": ["caps_lock", "shift"] } + }, + "to": [ + { + "key_code": "b", + "modifiers": ["left_control"] + }, + { "key_code": "e" } + ], + "type": "basic" + }, + { + "conditions": [ + { + "name": "tmux_prefix_mode", + "type": "variable_if", + "value": 1 + } + ], + "from": { + "key_code": "f", + "modifiers": { "optional": ["caps_lock", "shift"] } + }, + "to": [ + { + "key_code": "b", + "modifiers": ["left_control"] + }, + { "key_code": "f" } + ], + "type": "basic" + }, + { + "conditions": [ + { + "name": "tmux_prefix_mode", + "type": "variable_if", + "value": 1 + } + ], + "from": { + "key_code": "g", + "modifiers": { "optional": ["caps_lock", "shift"] } + }, + "to": [ + { + "key_code": "b", + "modifiers": ["left_control"] + }, + { "key_code": "g" } + ], + "type": "basic" + }, + { + "conditions": [ + { + "name": "tmux_prefix_mode", + "type": "variable_if", + "value": 1 + } + ], + "from": { + "key_code": "h", + "modifiers": { "optional": ["caps_lock", "shift"] } + }, + "to": [ + { + "key_code": "b", + "modifiers": ["left_control"] + }, + { "key_code": "h" } + ], + "type": "basic" + }, + { + "conditions": [ + { + "name": "tmux_prefix_mode", + "type": "variable_if", + "value": 1 + } + ], + "from": { + "key_code": "i", + "modifiers": { "optional": ["caps_lock", "shift"] } + }, + "to": [ + { + "key_code": "b", + "modifiers": ["left_control"] + }, + { "key_code": "i" } + ], + "type": "basic" + }, + { + "conditions": [ + { + "name": "tmux_prefix_mode", + "type": "variable_if", + "value": 1 + } + ], + "from": { + "key_code": "j", + "modifiers": { "optional": ["caps_lock", "shift"] } + }, + "to": [ + { + "key_code": "b", + "modifiers": ["left_control"] + }, + { "key_code": "j" } + ], + "type": "basic" + }, + { + "conditions": [ + { + "name": "tmux_prefix_mode", + "type": "variable_if", + "value": 1 + } + ], + "from": { + "key_code": "k", + "modifiers": { "optional": ["caps_lock", "shift"] } + }, + "to": [ + { + "key_code": "b", + "modifiers": ["left_control"] + }, + { "key_code": "k" } + ], + "type": "basic" + }, + { + "conditions": [ + { + "name": "tmux_prefix_mode", + "type": "variable_if", + "value": 1 + } + ], + "from": { + "key_code": "l", + "modifiers": { "optional": ["caps_lock", "shift"] } + }, + "to": [ + { + "key_code": "b", + "modifiers": ["left_control"] + }, + { "key_code": "l" } + ], + "type": "basic" + }, + { + "conditions": [ + { + "name": "tmux_prefix_mode", + "type": "variable_if", + "value": 1 + } + ], + "from": { + "key_code": "m", + "modifiers": { "optional": ["caps_lock", "shift"] } + }, + "to": [ + { + "key_code": "b", + "modifiers": ["left_control"] + }, + { "key_code": "m" } + ], + "type": "basic" + }, + { + "conditions": [ + { + "name": "tmux_prefix_mode", + "type": "variable_if", + "value": 1 + } + ], + "from": { + "key_code": "n", + "modifiers": { "optional": ["caps_lock", "shift"] } + }, + "to": [ + { + "key_code": "b", + "modifiers": ["left_control"] + }, + { "key_code": "n" } + ], + "type": "basic" + }, + { + "conditions": [ + { + "name": "tmux_prefix_mode", + "type": "variable_if", + "value": 1 + } + ], + "from": { + "key_code": "o", + "modifiers": { "optional": ["caps_lock", "shift"] } + }, + "to": [ + { + "key_code": "b", + "modifiers": ["left_control"] + }, + { "key_code": "o" } + ], + "type": "basic" + }, + { + "conditions": [ + { + "name": "tmux_prefix_mode", + "type": "variable_if", + "value": 1 + } + ], + "from": { + "key_code": "p", + "modifiers": { "optional": ["caps_lock", "shift"] } + }, + "to": [ + { + "key_code": "b", + "modifiers": ["left_control"] + }, + { "key_code": "p" } + ], + "type": "basic" + }, + { + "conditions": [ + { + "name": "tmux_prefix_mode", + "type": "variable_if", + "value": 1 + } + ], + "from": { + "key_code": "q", + "modifiers": { "optional": ["caps_lock", "shift"] } + }, + "to": [ + { + "key_code": "b", + "modifiers": ["left_control"] + }, + { "key_code": "q" } + ], + "type": "basic" + }, + { + "conditions": [ + { + "name": "tmux_prefix_mode", + "type": "variable_if", + "value": 1 + } + ], + "from": { + "key_code": "r", + "modifiers": { "optional": ["caps_lock", "shift"] } + }, + "to": [ + { + "key_code": "b", + "modifiers": ["left_control"] + }, + { "key_code": "r" } + ], + "type": "basic" + }, + { + "conditions": [ + { + "name": "tmux_prefix_mode", + "type": "variable_if", + "value": 1 + } + ], + "from": { + "key_code": "s", + "modifiers": { "optional": ["caps_lock", "shift"] } + }, + "to": [ + { + "key_code": "b", + "modifiers": ["left_control"] + }, + { "key_code": "s" } + ], + "type": "basic" + }, + { + "conditions": [ + { + "name": "tmux_prefix_mode", + "type": "variable_if", + "value": 1 + } + ], + "from": { + "key_code": "t", + "modifiers": { "optional": ["caps_lock", "shift"] } + }, + "to": [ + { + "key_code": "b", + "modifiers": ["left_control"] + }, + { "key_code": "t" } + ], + "type": "basic" + }, + { + "conditions": [ + { + "name": "tmux_prefix_mode", + "type": "variable_if", + "value": 1 + } + ], + "from": { + "key_code": "u", + "modifiers": { "optional": ["caps_lock", "shift"] } + }, + "to": [ + { + "key_code": "b", + "modifiers": ["left_control"] + }, + { "key_code": "u" } + ], + "type": "basic" + }, + { + "conditions": [ + { + "name": "tmux_prefix_mode", + "type": "variable_if", + "value": 1 + } + ], + "from": { + "key_code": "v", + "modifiers": { "optional": ["caps_lock", "shift"] } + }, + "to": [ + { + "key_code": "b", + "modifiers": ["left_control"] + }, + { "key_code": "v" } + ], + "type": "basic" + }, + { + "conditions": [ + { + "name": "tmux_prefix_mode", + "type": "variable_if", + "value": 1 + } + ], + "from": { + "key_code": "w", + "modifiers": { "optional": ["caps_lock", "shift"] } + }, + "to": [ + { + "key_code": "b", + "modifiers": ["left_control"] + }, + { "key_code": "w" } + ], + "type": "basic" + }, + { + "conditions": [ + { + "name": "tmux_prefix_mode", + "type": "variable_if", + "value": 1 + } + ], + "from": { + "key_code": "x", + "modifiers": { "optional": ["caps_lock", "shift"] } + }, + "to": [ + { + "key_code": "b", + "modifiers": ["left_control"] + }, + { "key_code": "x" } + ], + "type": "basic" + }, + { + "conditions": [ + { + "name": "tmux_prefix_mode", + "type": "variable_if", + "value": 1 + } + ], + "from": { + "key_code": "y", + "modifiers": { "optional": ["caps_lock", "shift"] } + }, + "to": [ + { + "key_code": "b", + "modifiers": ["left_control"] + }, + { "key_code": "y" } + ], + "type": "basic" + }, + { + "conditions": [ + { + "name": "tmux_prefix_mode", + "type": "variable_if", + "value": 1 + } + ], + "from": { + "key_code": "z", + "modifiers": { "optional": ["caps_lock", "shift"] } + }, + "to": [ + { + "key_code": "b", + "modifiers": ["left_control"] + }, + { "key_code": "z" } + ], + "type": "basic" + }, + { + "conditions": [ + { + "name": "tmux_prefix_mode", + "type": "variable_if", + "value": 1 + } + ], + "from": { + "key_code": "0", + "modifiers": { "optional": ["caps_lock", "shift"] } + }, + "to": [ + { + "key_code": "b", + "modifiers": ["left_control"] + }, + { "key_code": "0" } + ], + "type": "basic" + }, + { + "conditions": [ + { + "name": "tmux_prefix_mode", + "type": "variable_if", + "value": 1 + } + ], + "from": { + "key_code": "1", + "modifiers": { "optional": ["caps_lock", "shift"] } + }, + "to": [ + { + "key_code": "b", + "modifiers": ["left_control"] + }, + { "key_code": "1" } + ], + "type": "basic" + }, + { + "conditions": [ + { + "name": "tmux_prefix_mode", + "type": "variable_if", + "value": 1 + } + ], + "from": { + "key_code": "2", + "modifiers": { "optional": ["caps_lock", "shift"] } + }, + "to": [ + { + "key_code": "b", + "modifiers": ["left_control"] + }, + { "key_code": "2" } + ], + "type": "basic" + }, + { + "conditions": [ + { + "name": "tmux_prefix_mode", + "type": "variable_if", + "value": 1 + } + ], + "from": { + "key_code": "3", + "modifiers": { "optional": ["caps_lock", "shift"] } + }, + "to": [ + { + "key_code": "b", + "modifiers": ["left_control"] + }, + { "key_code": "3" } + ], + "type": "basic" + }, + { + "conditions": [ + { + "name": "tmux_prefix_mode", + "type": "variable_if", + "value": 1 + } + ], + "from": { + "key_code": "4", + "modifiers": { "optional": ["caps_lock", "shift"] } + }, + "to": [ + { + "key_code": "b", + "modifiers": ["left_control"] + }, + { "key_code": "4" } + ], + "type": "basic" + }, + { + "conditions": [ + { + "name": "tmux_prefix_mode", + "type": "variable_if", + "value": 1 + } + ], + "from": { + "key_code": "5", + "modifiers": { "optional": ["caps_lock", "shift"] } + }, + "to": [ + { + "key_code": "b", + "modifiers": ["left_control"] + }, + { "key_code": "5" } + ], + "type": "basic" + }, + { + "conditions": [ + { + "name": "tmux_prefix_mode", + "type": "variable_if", + "value": 1 + } + ], + "from": { + "key_code": "6", + "modifiers": { "optional": ["caps_lock", "shift"] } + }, + "to": [ + { + "key_code": "b", + "modifiers": ["left_control"] + }, + { "key_code": "6" } + ], + "type": "basic" + }, + { + "conditions": [ + { + "name": "tmux_prefix_mode", + "type": "variable_if", + "value": 1 + } + ], + "from": { + "key_code": "7", + "modifiers": { "optional": ["caps_lock", "shift"] } + }, + "to": [ + { + "key_code": "b", + "modifiers": ["left_control"] + }, + { "key_code": "7" } + ], + "type": "basic" + }, + { + "conditions": [ + { + "name": "tmux_prefix_mode", + "type": "variable_if", + "value": 1 + } + ], + "from": { + "key_code": "8", + "modifiers": { "optional": ["caps_lock", "shift"] } + }, + "to": [ + { + "key_code": "b", + "modifiers": ["left_control"] + }, + { "key_code": "8" } + ], + "type": "basic" + }, + { + "conditions": [ + { + "name": "tmux_prefix_mode", + "type": "variable_if", + "value": 1 + } + ], + "from": { + "key_code": "9", + "modifiers": { "optional": ["caps_lock", "shift"] } + }, + "to": [ + { + "key_code": "b", + "modifiers": ["left_control"] + }, + { "key_code": "9" } + ], + "type": "basic" + }, + { + "conditions": [ + { + "name": "tmux_prefix_mode", + "type": "variable_if", + "value": 1 + } + ], + "from": { + "key_code": "comma", + "modifiers": { "optional": ["caps_lock", "shift"] } + }, + "to": [ + { + "key_code": "b", + "modifiers": ["left_control"] + }, + { "key_code": "comma" } + ], + "type": "basic" + }, + { + "conditions": [ + { + "name": "tmux_prefix_mode", + "type": "variable_if", + "value": 1 + } + ], + "from": { + "key_code": "slash", + "modifiers": { "optional": ["caps_lock", "shift"] } + }, + "to": [ + { + "key_code": "b", + "modifiers": ["left_control"] + }, + { "key_code": "slash" } + ], + "type": "basic" + }, + { + "conditions": [ + { + "name": "tmux_prefix_mode", + "type": "variable_if", + "value": 1 + } + ], + "from": { + "key_code": "period", + "modifiers": { "optional": ["caps_lock", "shift"] } + }, + "to": [ + { + "key_code": "b", + "modifiers": ["left_control"] + }, + { "key_code": "period" } + ], + "type": "basic" + }, + { + "conditions": [ + { + "name": "tmux_prefix_mode", + "type": "variable_if", + "value": 1 + } + ], + "from": { + "key_code": "semicolon", + "modifiers": { "optional": ["caps_lock", "shift"] } + }, + "to": [ + { + "key_code": "b", + "modifiers": ["left_control"] + }, + { "key_code": "semicolon" } + ], + "type": "basic" + }, + { + "conditions": [ + { + "name": "tmux_prefix_mode", + "type": "variable_if", + "value": 1 + } + ], + "from": { + "key_code": "quote", + "modifiers": { "optional": ["caps_lock", "shift"] } + }, + "to": [ + { + "key_code": "b", + "modifiers": ["left_control"] + }, + { "key_code": "quote" } + ], + "type": "basic" + }, + { + "conditions": [ + { + "name": "tmux_prefix_mode", + "type": "variable_if", + "value": 1 + } + ], + "from": { + "key_code": "open_bracket", + "modifiers": { "optional": ["caps_lock", "shift"] } + }, + "to": [ + { + "key_code": "b", + "modifiers": ["left_control"] + }, + { "key_code": "open_bracket" } + ], + "type": "basic" + }, + { + "conditions": [ + { + "name": "tmux_prefix_mode", + "type": "variable_if", + "value": 1 + } + ], + "from": { + "key_code": "close_bracket", + "modifiers": { "optional": ["caps_lock", "shift"] } + }, + "to": [ + { + "key_code": "b", + "modifiers": ["left_control"] + }, + { "key_code": "close_bracket" } + ], + "type": "basic" + } + ] + } + ] + }, + "devices": [ + { + "identifiers": { "is_keyboard": true }, + "simple_modifications": [ + { + "from": { "key_code": "right_option" }, + "to": [{ "apple_vendor_top_case_key_code": "keyboard_fn" }] + } + ] + }, + { + "identifiers": { + "is_keyboard": true, + "product_id": 183, + "vendor_id": 5426 + }, + "ignore": true + } + ], + "fn_function_keys": [ + { + "from": { "key_code": "f3" }, + "to": [{ "apple_vendor_top_case_key_code": "illumination_down" }] + }, + { + "from": { "key_code": "f4" }, + "to": [{ "apple_vendor_top_case_key_code": "illumination_up" }] + } + ], + "name": "Default profile", + "selected": true, + "virtual_hid_keyboard": { "keyboard_type_v2": "ansi" } + } + ] +} \ No newline at end of file