Skip to content

Instantly share code, notes, and snippets.

@guilsa
Created September 27, 2025 05:05
Show Gist options
  • Select an option

  • Save guilsa/90f2fbcda104b6e1707d4cbe2788cd82 to your computer and use it in GitHub Desktop.

Select an option

Save guilsa/90f2fbcda104b6e1707d4cbe2788cd82 to your computer and use it in GitHub Desktop.
My macOS Karabiner complex modifications

Hyper Key (Caps Lock) & Caps Lock on Tap

hyper_key.json

{
  "title": "Hyper Key (Caps Lock) & Caps Lock on Tap",
  "rules": [
    {
      "description": "Caps Lock -> Hyper Key (⌃⌥⌘⇧) when held, Caps Lock when tapped.",
      "manipulators": [
        {
          "type": "basic",
          "from": {
            "key_code": "caps_lock",
            "modifiers": {
              "optional": [
                "any"
              ]
            }
          },
          "to_if_held_down": [
            {
              "key_code": "left_shift",
              "modifiers": [
                "left_control",
                "left_option",
                "left_command"
              ]
            }
          ],
          "to_if_alone": [
            {
              "key_code": "caps_lock"
            }
          ]
        }
      ]
    }
  ]
}

Hyper Key Custom Scripts

copy-then-run-script.json

{
  "title": "Hyper Key Custom Scripts",
  "rules": [
    {
      "description": "Hyper+X: Copy to clipboard, then run a Node.js script",
      "manipulators": [
        {
          "type": "basic",
          "from": {
            "key_code": "x",
            "modifiers": {
              "mandatory": [
                "left_control",
                "left_option",
                "left_command",
                "left_shift"
              ]
            }
          },
          "to": [
            {
              "key_code": "c",
              "modifiers": ["left_command"]
            },
            {
              "shell_command": "sleep 0.1 && /opt/homebrew/bin/node /Users/gui/dev/path-to-node-script/index.js >> /tmp/random-app.log 2>&1"
            }
          ]
        }
      ]
    }
  ]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment