Skip to content

Instantly share code, notes, and snippets.

@flyingeek
Last active August 21, 2021 11:26
Show Gist options
  • Save flyingeek/b0889580110020dc82e2e327fd8ed87e to your computer and use it in GitHub Desktop.
Save flyingeek/b0889580110020dc82e2e327fd8ed87e to your computer and use it in GitHub Desktop.
Karabiner Elements (Mac OSX) complex modification to remap keypad comma to period
  • remap comma keypad key to period (Useful for french AZERTY users).
  • remap shift+command+. to shif+command+fn+. in finder (Useful for french AZERTY users).
  • remap capslock to escape on single press, capslock to ctl on press and hold, but only in Terminal.
  • remap capslock to meta (command+control+option+shift) unless in Terminal.
  • SuperDuper mode from jasonrudolph

To install:

  • import this complex modification rule by using this url: karabiner://karabiner/assets/complex_modifications/import?url=https://gist.githubusercontent.com/flyingeek/b0889580110020dc82e2e327fd8ed87e/raw/keypadcommatoperiod.json
  • import this complex modification rule by using this url: karabiner://karabiner/assets/complex_modifications/import?url=https://gist.githubusercontent.com/flyingeek/b0889580110020dc82e2e327fd8ed87e/raw/c62345869f4a0d99373d71ec76841d449e84a944/toggle_hidden_files_in_finder_without_fn.json
  • import this complex modification rule by using this url: karabiner://karabiner/assets/complex_modifications/import?url=https://gist.githubusercontent.com/flyingeek/b0889580110020dc82e2e327fd8ed87e/raw/capslock_to_esc_or_ctl_if_term.json
  • import this complex modification rule by using this url: karabiner://karabiner/assets/complex_modifications/import?url=https://gist.githubusercontent.com/flyingeek/b0889580110020dc82e2e327fd8ed87e/raw/capslock_to_meta_unless_term.json
  • import this complex modification rule by using this url: karabiner://karabiner/assets/complex_modifications/import?url=https://gist.githubusercontent.com/flyingeek/b0889580110020dc82e2e327fd8ed87e/raw/superduper.json

Enable the rules from Karabiner Elements by going to the "Complex modifications" tab and click on Add rules (bottom left). Choose "invert keypad comma to period" and click on "Enable"

{
"title": "capslock to Esc or Ctl (if in Term)",
"rules": [
{
"description": "Caps Lock to Escape on single press, Control on press and hold. (only in Terminal).",
"manipulators": [
{
"from": {
"key_code": "caps_lock",
"modifiers": {
"optional": [
"any"
]
}
},
"to": [
{
"key_code": "left_control"
}
],
"to_if_alone": [
{
"key_code": "escape",
"hold_down_milliseconds": 500
}
],
"type": "basic",
"conditions": [{
"type": "frontmost_application_if",
"bundle_identifiers": [
"^com\\.apple\\.Terminal$",
"^com\\.googlecode\\.iterm2$"
]
}]
}
]
}]
}
{
"title": "capslock to meta unless Term",
"rules": [
{
"manipulators": [
{
"description": "Change caps_lock to command+control+option+shift. (unless Term).",
"from": {
"key_code": "caps_lock",
"modifiers": {
"optional": [
"any"
]
}
},
"to": [
{
"key_code": "left_shift",
"modifiers": [
"left_command",
"left_control",
"left_option"
]
}
],
"to_if_alone": [
{
"key_code": "caps_lock",
"hold_down_milliseconds": 500
}
],
"type": "basic",
"conditions": [{
"type": "frontmost_application_unless",
"bundle_identifiers": [
"^com\\.apple\\.Terminal$",
"^com\\.googlecode\\.iterm2$"
]
}]
}
]
}]
}
{
"title": "keypad_comma to period",
"rules": [
{
"description": "invert keypad comma to period",
"manipulators": [
{
"from": {
"key_code": "keypad_period"
},
"to": [
{
"key_code": "keypad_period",
"modifiers": ["left_shift"]
}
],
"type": "basic"
},
{
"from": {
"key_code": "keypad_period",
"modifiers": {
"mandatory": ["shift"]
}
},
"to": [
{
"key_code": "keypad_period"
}
],
"type": "basic"
}
]
}
]
}
{
"title": "Super Duper by jasonrudolph",
"rules": [{
"description": "S+D -> (S)uper(D)uper Mode",
"manipulators": [{
"from": {
"simultaneous": [{
"key_code": "s"
},
{
"key_code": "d"
}
],
"simultaneous_options": {
"detect_key_down_uninterruptedly": true,
"key_down_order": "insensitive",
"key_up_order": "insensitive",
"key_up_when": "any",
"to_after_key_up": [{
"set_variable": {
"name": "superduper-mode",
"value": 0
}
}]
}
},
"to": [{
"set_variable": {
"name": "superduper-mode",
"value": 1
}
}],
"type": "basic"
}]
},
{
"description": "(S)uper(D)uper + H -> Left",
"manipulators": [{
"conditions": [{
"name": "superduper-mode",
"type": "variable_if",
"value": 1
}],
"from": {
"key_code": "h",
"modifiers": {
"optional": [
"any"
]
}
},
"to": [{
"key_code": "left_arrow"
}],
"type": "basic"
}]
},
{
"description": "(S)uper(D)uper + J -> Down",
"manipulators": [{
"conditions": [{
"name": "superduper-mode",
"type": "variable_if",
"value": 1
}],
"from": {
"key_code": "j",
"modifiers": {
"optional": [
"any"
]
}
},
"to": [{
"key_code": "down_arrow"
}],
"type": "basic"
}]
},
{
"description": "(S)uper(D)uper + K -> Up",
"manipulators": [{
"conditions": [{
"name": "superduper-mode",
"type": "variable_if",
"value": 1
}],
"from": {
"key_code": "k",
"modifiers": {
"optional": [
"any"
]
}
},
"to": [{
"key_code": "up_arrow"
}],
"type": "basic"
}]
},
{
"description": "(S)uper(D)uper + L -> Right",
"manipulators": [{
"conditions": [{
"name": "superduper-mode",
"type": "variable_if",
"value": 1
}],
"from": {
"key_code": "l",
"modifiers": {
"optional": [
"any"
]
}
},
"to": [{
"key_code": "right_arrow"
}],
"type": "basic"
}]
},
{
"description": "(S)uper(D)uper + A -> Option",
"manipulators": [{
"conditions": [{
"name": "superduper-mode",
"type": "variable_if",
"value": 1
}],
"from": {
"key_code": "a",
"modifiers": {
"optional": [
"any"
]
}
},
"to": [{
"key_code": "left_option"
}],
"type": "basic"
}]
},
{
"description": "(S)uper(D)uper + F -> Command",
"manipulators": [{
"conditions": [{
"name": "superduper-mode",
"type": "variable_if",
"value": 1
}],
"from": {
"key_code": "f",
"modifiers": {
"optional": [
"any"
]
}
},
"to": [{
"key_code": "right_command"
}],
"type": "basic"
}]
},
{
"description": "(S)uper(D)uper + Space -> Shift",
"manipulators": [{
"conditions": [{
"name": "superduper-mode",
"type": "variable_if",
"value": 1
}],
"from": {
"key_code": "spacebar",
"modifiers": {
"optional": [
"any"
]
}
},
"to": [{
"key_code": "right_shift"
}],
"type": "basic"
}]
},
{
"description": "(S)uper(D)uper + U -> First Tab",
"manipulators": [{
"conditions": [{
"name": "superduper-mode",
"type": "variable_if",
"value": 1
}],
"from": {
"key_code": "u",
"modifiers": {
"optional": [
"any"
]
}
},
"to": [{
"key_code": "1",
"modifiers": [
"left_command"
]
}],
"type": "basic"
}]
},
{
"description": "(S)uper(D)uper + I -> Prev Tab",
"manipulators": [{
"conditions": [{
"name": "superduper-mode",
"type": "variable_if",
"value": 1
}],
"from": {
"key_code": "i",
"modifiers": {
"optional": [
"any"
]
}
},
"to": [{
"key_code": "open_bracket",
"modifiers": [
"left_command",
"left_shift"
]
}],
"type": "basic"
}]
},
{
"description": "(S)uper(D)uper + O -> Next Tab",
"manipulators": [{
"conditions": [{
"name": "superduper-mode",
"type": "variable_if",
"value": 1
}],
"from": {
"key_code": "o",
"modifiers": {
"optional": [
"any"
]
}
},
"to": [{
"key_code": "close_bracket",
"modifiers": [
"left_command",
"left_shift"
]
}],
"type": "basic"
}]
},
{
"description": "(S)uper(D)uper + P -> Last Tab",
"manipulators": [{
"conditions": [{
"name": "superduper-mode",
"type": "variable_if",
"value": 1
}],
"from": {
"key_code": "p",
"modifiers": {
"optional": [
"any"
]
}
},
"to": [{
"key_code": "9",
"modifiers": [
"left_command"
]
}],
"type": "basic"
}]
}
]
}
{
"title": "Hide/Show hidden files in Finder without Fn key (AZERTY)",
"rules": [
{
"manipulators": [
{
"type": "basic",
"description": "Hide/Show hidden files in Finder without Fn key (AZERTY)",
"from": {
"modifiers": {
"mandatory": [
"left_command",
"left_shift"
]
},
"key_code": "comma"
},
"conditions": [
{
"type": "frontmost_application_if",
"bundle_identifiers": [
"^com\\.apple\\.finder$"
],
"description": "shortcut to use in finder"
}
],
"to": [
{
"repeat": false,
"key_code": "comma",
"modifiers": [
"left_shift",
"left_command",
"fn"
]
}
]
}
]
}
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment