From 2291abd47c971da8336d9ea4ba07114dd8a8584f Mon Sep 17 00:00:00 2001 From: Daniel Barber Date: Thu, 18 Apr 2019 14:38:58 -0400 Subject: [PATCH] Update Karabiner config --- .../complex_modifications/1513786036.json | 507 ++++++++++++++++++ .../complex_modifications/1518718726.json | 191 +++++++ .../complex_modifications/1521038884.json | 68 +++ config/karabiner/karabiner.json | 81 ++- 4 files changed, 846 insertions(+), 1 deletion(-) create mode 100644 config/karabiner/assets/complex_modifications/1513786036.json create mode 100644 config/karabiner/assets/complex_modifications/1518718726.json create mode 100644 config/karabiner/assets/complex_modifications/1521038884.json diff --git a/config/karabiner/assets/complex_modifications/1513786036.json b/config/karabiner/assets/complex_modifications/1513786036.json new file mode 100644 index 0000000..b5822d2 --- /dev/null +++ b/config/karabiner/assets/complex_modifications/1513786036.json @@ -0,0 +1,507 @@ +{ + "title": "Map fn + number keys to function keys (rev 2)", + "rules": [ + { + "description": "Map fn + number keys to their corresponding function keys (rev 1)", + "manipulators": [ + { + "type": "basic", + "from": { + "key_code": "1", + "modifiers": { + "mandatory": [ + "fn" + ], + "optional": [ + "any" + ] + } + }, + "to": [ + { + "key_code": "f1", + "modifiers": [ + "fn" + ] + } + ] + }, + { + "type": "basic", + "from": { + "key_code": "2", + "modifiers": { + "mandatory": [ + "fn" + ], + "optional": [ + "any" + ] + } + }, + "to": [ + { + "key_code": "f2", + "modifiers": [ + "fn" + ] + } + ] + }, + { + "type": "basic", + "from": { + "key_code": "3", + "modifiers": { + "mandatory": [ + "fn" + ], + "optional": [ + "any" + ] + } + }, + "to": [ + { + "key_code": "f3", + "modifiers": [ + "fn" + ] + } + ] + }, + { + "type": "basic", + "from": { + "key_code": "4", + "modifiers": { + "mandatory": [ + "fn" + ], + "optional": [ + "any" + ] + } + }, + "to": [ + { + "key_code": "f4", + "modifiers": [ + "fn" + ] + } + ] + }, + { + "type": "basic", + "from": { + "key_code": "5", + "modifiers": { + "mandatory": [ + "fn" + ], + "optional": [ + "any" + ] + } + }, + "to": [ + { + "key_code": "f5", + "modifiers": [ + "fn" + ] + } + ] + }, + { + "type": "basic", + "from": { + "key_code": "6", + "modifiers": { + "mandatory": [ + "fn" + ], + "optional": [ + "any" + ] + } + }, + "to": [ + { + "key_code": "f6", + "modifiers": [ + "fn" + ] + } + ] + }, + { + "type": "basic", + "from": { + "key_code": "7", + "modifiers": { + "mandatory": [ + "fn" + ], + "optional": [ + "any" + ] + } + }, + "to": [ + { + "key_code": "f7", + "modifiers": [ + "fn" + ] + } + ] + }, + { + "type": "basic", + "from": { + "key_code": "8", + "modifiers": { + "mandatory": [ + "fn" + ], + "optional": [ + "any" + ] + } + }, + "to": [ + { + "key_code": "f8", + "modifiers": [ + "fn" + ] + } + ] + }, + { + "type": "basic", + "from": { + "key_code": "9", + "modifiers": { + "mandatory": [ + "fn" + ], + "optional": [ + "any" + ] + } + }, + "to": [ + { + "key_code": "f9", + "modifiers": [ + "fn" + ] + } + ] + }, + { + "type": "basic", + "from": { + "key_code": "0", + "modifiers": { + "mandatory": [ + "fn" + ], + "optional": [ + "any" + ] + } + }, + "to": [ + { + "key_code": "f10", + "modifiers": [ + "fn" + ] + } + ] + }, + { + "type": "basic", + "from": { + "key_code": "hyphen", + "modifiers": { + "mandatory": [ + "fn" + ], + "optional": [ + "any" + ] + } + }, + "to": [ + { + "key_code": "f11", + "modifiers": [ + "fn" + ] + } + ] + }, + { + "type": "basic", + "from": { + "key_code": "equal_sign", + "modifiers": { + "mandatory": [ + "fn" + ], + "optional": [ + "any" + ] + } + }, + "to": [ + { + "key_code": "f12", + "modifiers": [ + "fn" + ] + } + ] + } + ] + }, + { + "description": "Map fn + number keys to their corresponding media control keys (rev 2)", + "manipulators": [ + { + "type": "basic", + "from": { + "key_code": "1", + "modifiers": { + "mandatory": [ + "fn" + ], + "optional": [ + "any" + ] + } + }, + "to": [ + { + "key_code": "f1" + } + ] + }, + { + "type": "basic", + "from": { + "key_code": "2", + "modifiers": { + "mandatory": [ + "fn" + ], + "optional": [ + "any" + ] + } + }, + "to": [ + { + "key_code": "f2" + } + ] + }, + { + "type": "basic", + "from": { + "key_code": "3", + "modifiers": { + "mandatory": [ + "fn" + ], + "optional": [ + "any" + ] + } + }, + "to": [ + { + "key_code": "f3" + } + ] + }, + { + "type": "basic", + "from": { + "key_code": "4", + "modifiers": { + "mandatory": [ + "fn" + ], + "optional": [ + "any" + ] + } + }, + "to": [ + { + "key_code": "f4" + } + ] + }, + { + "type": "basic", + "from": { + "key_code": "5", + "modifiers": { + "mandatory": [ + "fn" + ], + "optional": [ + "any" + ] + } + }, + "to": [ + { + "key_code": "f5" + } + ] + }, + { + "type": "basic", + "from": { + "key_code": "6", + "modifiers": { + "mandatory": [ + "fn" + ], + "optional": [ + "any" + ] + } + }, + "to": [ + { + "key_code": "f6" + } + ] + }, + { + "type": "basic", + "from": { + "key_code": "7", + "modifiers": { + "mandatory": [ + "fn" + ], + "optional": [ + "any" + ] + } + }, + "to": [ + { + "key_code": "f7" + } + ] + }, + { + "type": "basic", + "from": { + "key_code": "8", + "modifiers": { + "mandatory": [ + "fn" + ], + "optional": [ + "any" + ] + } + }, + "to": [ + { + "key_code": "f8" + } + ] + }, + { + "type": "basic", + "from": { + "key_code": "9", + "modifiers": { + "mandatory": [ + "fn" + ], + "optional": [ + "any" + ] + } + }, + "to": [ + { + "key_code": "f9" + } + ] + }, + { + "type": "basic", + "from": { + "key_code": "0", + "modifiers": { + "mandatory": [ + "fn" + ], + "optional": [ + "any" + ] + } + }, + "to": [ + { + "key_code": "f10" + } + ] + }, + { + "type": "basic", + "from": { + "key_code": "hyphen", + "modifiers": { + "mandatory": [ + "fn" + ], + "optional": [ + "any" + ] + } + }, + "to": [ + { + "key_code": "f11" + } + ] + }, + { + "type": "basic", + "from": { + "key_code": "equal_sign", + "modifiers": { + "mandatory": [ + "fn" + ], + "optional": [ + "any" + ] + } + }, + "to": [ + { + "key_code": "f12" + } + ] + } + ] + } + ] +} diff --git a/config/karabiner/assets/complex_modifications/1518718726.json b/config/karabiner/assets/complex_modifications/1518718726.json new file mode 100644 index 0000000..a162369 --- /dev/null +++ b/config/karabiner/assets/complex_modifications/1518718726.json @@ -0,0 +1,191 @@ +{ + "title": "Prevent unintended command-q (rev 2)", + "rules": [ + { + "description": "Quit application by pressing command-q twice", + "manipulators": [ + { + "type": "basic", + "conditions": [ + { + "type": "variable_if", + "name": "command-q", + "value": 1 + } + ], + "from": { + "key_code": "q", + "modifiers": { + "mandatory": [ + "command" + ], + "optional": [ + "caps_lock" + ] + } + }, + "to": [ + { + "key_code": "q", + "modifiers": "left_command" + } + ] + }, + { + "type": "basic", + "from": { + "key_code": "q", + "modifiers": { + "mandatory": [ + "command" + ], + "optional": [ + "caps_lock" + ] + } + }, + "to": [ + { + "set_variable": { + "name": "command-q", + "value": 1 + } + } + ], + "to_delayed_action": { + "to_if_invoked": [ + { + "set_variable": { + "name": "command-q", + "value": 0 + } + } + ], + "to_if_canceled": [ + { + "set_variable": { + "name": "command-q", + "value": 0 + } + } + ] + } + } + ] + }, + { + "description": "Quit application by holding command-q", + "manipulators": [ + { + "type": "basic", + "from": { + "key_code": "q", + "modifiers": { + "mandatory": [ + "command" + ], + "optional": [ + "caps_lock" + ] + } + }, + "to_if_held_down": [ + { + "key_code": "q", + "modifiers": [ + "left_command" + ], + "repeat": false + } + ] + } + ] + }, + { + "description": "Quit Safari by pressing command-q twice", + "manipulators": [ + { + "type": "basic", + "conditions": [ + { + "type": "variable_if", + "name": "command-q", + "value": 1 + }, + { + "type": "frontmost_application_if", + "bundle_identifiers": [ + "^com\\.apple\\.Safari$" + ] + } + ], + "from": { + "key_code": "q", + "modifiers": { + "mandatory": [ + "command" + ], + "optional": [ + "caps_lock" + ] + } + }, + "to": [ + { + "key_code": "q", + "modifiers": "left_command" + } + ] + }, + { + "type": "basic", + "conditions": [ + { + "type": "frontmost_application_if", + "bundle_identifiers": [ + "^com\\.apple\\.Safari$" + ] + } + ], + "from": { + "key_code": "q", + "modifiers": { + "mandatory": [ + "command" + ], + "optional": [ + "caps_lock" + ] + } + }, + "to": [ + { + "set_variable": { + "name": "command-q", + "value": 1 + } + } + ], + "to_delayed_action": { + "to_if_invoked": [ + { + "set_variable": { + "name": "command-q", + "value": 0 + } + } + ], + "to_if_canceled": [ + { + "set_variable": { + "name": "command-q", + "value": 0 + } + } + ] + } + } + ] + } + ] +} diff --git a/config/karabiner/assets/complex_modifications/1521038884.json b/config/karabiner/assets/complex_modifications/1521038884.json new file mode 100644 index 0000000..2475402 --- /dev/null +++ b/config/karabiner/assets/complex_modifications/1521038884.json @@ -0,0 +1,68 @@ +{ + "title": "device_if,device_unless example", + "rules": [ + { + "description": "Open Karabiner-Elements by f5 in non-Apple keyboards", + "manipulators": [ + { + "conditions": [ + { + "type": "device_unless", + "identifiers": [ + { + "vendor_id": 1452 + } + ] + } + ], + "type": "basic", + "from": { + "key_code": "f5", + "modifiers": { + "optional": [ + "any" + ] + } + }, + "to": [ + { + "shell_command": "open -a 'Karabiner-Elements.app'" + } + ] + } + ] + }, + { + "description": "Open Karabiner-EventViewer by f6 in HHKB BT JP keyboards", + "manipulators": [ + { + "conditions": [ + { + "type": "device_if", + "identifiers": [ + { + "vendor_id": 1278, + "product_id": 515 + } + ] + } + ], + "type": "basic", + "from": { + "key_code": "f6", + "modifiers": { + "optional": [ + "any" + ] + } + }, + "to": [ + { + "shell_command": "open -a 'Karabiner-EventViewer.app'" + } + ] + } + ] + } + ] +} diff --git a/config/karabiner/karabiner.json b/config/karabiner/karabiner.json index 29ba46f..ea99e9b 100644 --- a/config/karabiner/karabiner.json +++ b/config/karabiner/karabiner.json @@ -676,6 +676,85 @@ "ignore": true, "manipulate_caps_lock_led": false, "simple_modifications": [] + }, + { + "disable_built_in_keyboard_if_exists": false, + "fn_function_keys": [], + "identifiers": { + "is_keyboard": true, + "is_pointing_device": false, + "product_id": 591, + "vendor_id": 1452 + }, + "ignore": false, + "manipulate_caps_lock_led": true, + "simple_modifications": [ + { + "from": { + "key_code": "caps_lock" + }, + "to": { + "key_code": "left_control" + } + } + ] + }, + { + "disable_built_in_keyboard_if_exists": false, + "fn_function_keys": [], + "identifiers": { + "is_keyboard": true, + "is_pointing_device": false, + "product_id": 598, + "vendor_id": 1452 + }, + "ignore": false, + "manipulate_caps_lock_led": true, + "simple_modifications": [ + { + "from": { + "key_code": "caps_lock" + }, + "to": { + "key_code": "left_control" + } + } + ] + }, + { + "disable_built_in_keyboard_if_exists": false, + "fn_function_keys": [], + "identifiers": { + "is_keyboard": true, + "is_pointing_device": false, + "product_id": 615, + "vendor_id": 76 + }, + "ignore": false, + "manipulate_caps_lock_led": true, + "simple_modifications": [ + { + "from": { + "key_code": "caps_lock" + }, + "to": { + "key_code": "left_control" + } + } + ] + }, + { + "disable_built_in_keyboard_if_exists": false, + "fn_function_keys": [], + "identifiers": { + "is_keyboard": true, + "is_pointing_device": true, + "product_id": 45081, + "vendor_id": 1133 + }, + "ignore": true, + "manipulate_caps_lock_led": false, + "simple_modifications": [] } ], "fn_function_keys": [ @@ -786,4 +865,4 @@ } } ] -} +} \ No newline at end of file