Skip to content

Instantly share code, notes, and snippets.

@borkweb
Last active February 22, 2026 19:12
Show Gist options
  • Select an option

  • Save borkweb/63f33406d7fd62d8e611f04fa8fcbc77 to your computer and use it in GitHub Desktop.

Select an option

Save borkweb/63f33406d7fd62d8e611f04fa8fcbc77 to your computer and use it in GitHub Desktop.
Alphabork Karabiner-Elements

Karabiner-Elements: Hyperkey & Alphabork

Custom Karabiner-Elements complex modifications for macOS that turn Caps Lock into a Hyper Key and provide quick access to special Unicode characters.

Hyperkey (Caps Lock Replacement)

Transforms Caps Lock into a dual-purpose key:

  • Hold Caps Lock → acts as a Hyper Key (⌘ + ⌃ + ⌥)
  • Tap Caps Lock alone → sends Escape

This gives you a powerful modifier key in a prime keyboard location while also providing quick Escape access — great for Vim users and power users alike.

Alphabork

Type special Unicode characters using the Hyper Key. Characters are inserted via clipboard (saving and restoring your existing clipboard contents).

Vowels with Macron (long marks)

Shortcut Character Shortcut Character
Hyper + A ā Hyper + Shift + A Ā
Hyper + E ē Hyper + Shift + E Ē
Hyper + I ī Hyper + Shift + I Ī
Hyper + O ō Hyper + Shift + O Ō
Hyper + U ū Hyper + Shift + U Ū
Hyper + Y ȳ Hyper + Shift + Y Ȳ

Special Consonants & Symbols

Shortcut Character Name Shortcut Character Name
Hyper + T þ Thorn Hyper + Shift + T Þ Thorn (upper)
Hyper + N ñ N with tilde Hyper + Shift + N Ñ N with tilde (upper)
Hyper + S ş S with cedilla Hyper + Shift + S Ş S with cedilla (upper)
Hyper + G ŋ Eng Hyper + Shift + G Ŋ Eng (upper)
Hyper + W ə Schwa Hyper + Shift + W Ə Schwa (upper)
Hyper + . · Middle dot

Installation

  1. Install Karabiner-Elements
  2. Copy the JSON files into ~/.config/karabiner/assets/complex_modifications/
  3. Open Karabiner-Elements → Complex ModificationsAdd rule
  4. Enable "Caps Lock acts as Hyper Key when held, Escape when tapped alone"
  5. Enable "Alphabork Characters via Caps Lock (Hyper Key)"

Notes

  • Alphabork uses a clipboard-based insertion method via AppleScript. There's a brief 50ms delay to ensure reliable pasting before restoring your original clipboard.
  • You must enable the Hyperkey rule (or otherwise map Caps Lock to ⌘⌃⌥) for Alphabork to work, since its shortcuts depend on the Hyper modifier.
{
"title": "Alphabork",
"rules": [
{
"description": "Alphabork Characters via Caps Lock (Hyper Key)",
"manipulators": [
{
"type": "basic",
"description": "Hyper+Shift+A → Ā",
"from": { "key_code": "a", "modifiers": { "mandatory": ["left_command", "left_control", "left_option", "shift"], "optional": ["any"] } },
"to": [ { "shell_command": "osascript -e 'set old to the clipboard' -e 'set the clipboard to (character id 256)' -e 'tell application \"System Events\" to keystroke \"v\" using command down' -e 'delay 0.05' -e 'set the clipboard to old'" } ]
},
{
"type": "basic",
"description": "Hyper+Shift+E → Ē",
"from": { "key_code": "e", "modifiers": { "mandatory": ["left_command", "left_control", "left_option", "shift"], "optional": ["any"] } },
"to": [ { "shell_command": "osascript -e 'set old to the clipboard' -e 'set the clipboard to (character id 274)' -e 'tell application \"System Events\" to keystroke \"v\" using command down' -e 'delay 0.05' -e 'set the clipboard to old'" } ]
},
{
"type": "basic",
"description": "Hyper+Shift+I → Ī",
"from": { "key_code": "i", "modifiers": { "mandatory": ["left_command", "left_control", "left_option", "shift"], "optional": ["any"] } },
"to": [ { "shell_command": "osascript -e 'set old to the clipboard' -e 'set the clipboard to (character id 298)' -e 'tell application \"System Events\" to keystroke \"v\" using command down' -e 'delay 0.05' -e 'set the clipboard to old'" } ]
},
{
"type": "basic",
"description": "Hyper+Shift+O → Ō",
"from": { "key_code": "o", "modifiers": { "mandatory": ["left_command", "left_control", "left_option", "shift"], "optional": ["any"] } },
"to": [ { "shell_command": "osascript -e 'set old to the clipboard' -e 'set the clipboard to (character id 332)' -e 'tell application \"System Events\" to keystroke \"v\" using command down' -e 'delay 0.05' -e 'set the clipboard to old'" } ]
},
{
"type": "basic",
"description": "Hyper+Shift+U → Ū",
"from": { "key_code": "u", "modifiers": { "mandatory": ["left_command", "left_control", "left_option", "shift"], "optional": ["any"] } },
"to": [ { "shell_command": "osascript -e 'set old to the clipboard' -e 'set the clipboard to (character id 362)' -e 'tell application \"System Events\" to keystroke \"v\" using command down' -e 'delay 0.05' -e 'set the clipboard to old'" } ]
},
{
"type": "basic",
"description": "Hyper+Shift+Y → Ȳ",
"from": { "key_code": "y", "modifiers": { "mandatory": ["left_command", "left_control", "left_option", "shift"], "optional": ["any"] } },
"to": [ { "shell_command": "osascript -e 'set old to the clipboard' -e 'set the clipboard to (character id 562)' -e 'tell application \"System Events\" to keystroke \"v\" using command down' -e 'delay 0.05' -e 'set the clipboard to old'" } ]
},
{
"type": "basic",
"description": "Hyper+Shift+W → Ə",
"from": { "key_code": "w", "modifiers": { "mandatory": ["left_command", "left_control", "left_option", "shift"], "optional": ["any"] } },
"to": [ { "shell_command": "osascript -e 'set old to the clipboard' -e 'set the clipboard to (character id 399)' -e 'tell application \"System Events\" to keystroke \"v\" using command down' -e 'delay 0.05' -e 'set the clipboard to old'" } ]
},
{
"type": "basic",
"description": "Hyper+Shift+S → Ş",
"from": { "key_code": "s", "modifiers": { "mandatory": ["left_command", "left_control", "left_option", "shift"], "optional": ["any"] } },
"to": [ { "shell_command": "osascript -e 'set old to the clipboard' -e 'set the clipboard to (character id 350)' -e 'tell application \"System Events\" to keystroke \"v\" using command down' -e 'delay 0.05' -e 'set the clipboard to old'" } ]
},
{
"type": "basic",
"description": "Hyper+Shift+T → Þ",
"from": { "key_code": "t", "modifiers": { "mandatory": ["left_command", "left_control", "left_option", "shift"], "optional": ["any"] } },
"to": [ { "shell_command": "osascript -e 'set old to the clipboard' -e 'set the clipboard to (character id 222)' -e 'tell application \"System Events\" to keystroke \"v\" using command down' -e 'delay 0.05' -e 'set the clipboard to old'" } ]
},
{
"type": "basic",
"description": "Hyper+Shift+N → Ñ",
"from": { "key_code": "n", "modifiers": { "mandatory": ["left_command", "left_control", "left_option", "shift"], "optional": ["any"] } },
"to": [ { "shell_command": "osascript -e 'set old to the clipboard' -e 'set the clipboard to (character id 209)' -e 'tell application \"System Events\" to keystroke \"v\" using command down' -e 'delay 0.05' -e 'set the clipboard to old'" } ]
},
{
"type": "basic",
"description": "Hyper+Shift+G → Ŋ",
"from": { "key_code": "g", "modifiers": { "mandatory": ["left_command", "left_control", "left_option", "shift"], "optional": ["any"] } },
"to": [ { "shell_command": "osascript -e 'set old to the clipboard' -e 'set the clipboard to (character id 330)' -e 'tell application \"System Events\" to keystroke \"v\" using command down' -e 'delay 0.05' -e 'set the clipboard to old'" } ]
},
{
"type": "basic",
"description": "Hyper+A → ā",
"from": { "key_code": "a", "modifiers": { "mandatory": ["left_command", "left_control", "left_option"], "optional": ["any"] } },
"to": [ { "shell_command": "osascript -e 'set old to the clipboard' -e 'set the clipboard to (character id 257)' -e 'tell application \"System Events\" to keystroke \"v\" using command down' -e 'delay 0.05' -e 'set the clipboard to old'" } ]
},
{
"type": "basic",
"description": "Hyper+E → ē",
"from": { "key_code": "e", "modifiers": { "mandatory": ["left_command", "left_control", "left_option"], "optional": ["any"] } },
"to": [ { "shell_command": "osascript -e 'set old to the clipboard' -e 'set the clipboard to (character id 275)' -e 'tell application \"System Events\" to keystroke \"v\" using command down' -e 'delay 0.05' -e 'set the clipboard to old'" } ]
},
{
"type": "basic",
"description": "Hyper+I → ī",
"from": { "key_code": "i", "modifiers": { "mandatory": ["left_command", "left_control", "left_option"], "optional": ["any"] } },
"to": [ { "shell_command": "osascript -e 'set old to the clipboard' -e 'set the clipboard to (character id 299)' -e 'tell application \"System Events\" to keystroke \"v\" using command down' -e 'delay 0.05' -e 'set the clipboard to old'" } ]
},
{
"type": "basic",
"description": "Hyper+O → ō",
"from": { "key_code": "o", "modifiers": { "mandatory": ["left_command", "left_control", "left_option"], "optional": ["any"] } },
"to": [ { "shell_command": "osascript -e 'set old to the clipboard' -e 'set the clipboard to (character id 333)' -e 'tell application \"System Events\" to keystroke \"v\" using command down' -e 'delay 0.05' -e 'set the clipboard to old'" } ]
},
{
"type": "basic",
"description": "Hyper+U → ū",
"from": { "key_code": "u", "modifiers": { "mandatory": ["left_command", "left_control", "left_option"], "optional": ["any"] } },
"to": [ { "shell_command": "osascript -e 'set old to the clipboard' -e 'set the clipboard to (character id 363)' -e 'tell application \"System Events\" to keystroke \"v\" using command down' -e 'delay 0.05' -e 'set the clipboard to old'" } ]
},
{
"type": "basic",
"description": "Hyper+Y → ȳ",
"from": { "key_code": "y", "modifiers": { "mandatory": ["left_command", "left_control", "left_option"], "optional": ["any"] } },
"to": [ { "shell_command": "osascript -e 'set old to the clipboard' -e 'set the clipboard to (character id 563)' -e 'tell application \"System Events\" to keystroke \"v\" using command down' -e 'delay 0.05' -e 'set the clipboard to old'" } ]
},
{
"type": "basic",
"description": "Hyper+W → ə",
"from": { "key_code": "w", "modifiers": { "mandatory": ["left_command", "left_control", "left_option"], "optional": ["any"] } },
"to": [ { "shell_command": "osascript -e 'set old to the clipboard' -e 'set the clipboard to (character id 601)' -e 'tell application \"System Events\" to keystroke \"v\" using command down' -e 'delay 0.05' -e 'set the clipboard to old'" } ]
},
{
"type": "basic",
"description": "Hyper+S → ş",
"from": { "key_code": "s", "modifiers": { "mandatory": ["left_command", "left_control", "left_option"], "optional": ["any"] } },
"to": [ { "shell_command": "osascript -e 'set old to the clipboard' -e 'set the clipboard to (character id 351)' -e 'tell application \"System Events\" to keystroke \"v\" using command down' -e 'delay 0.05' -e 'set the clipboard to old'" } ]
},
{
"type": "basic",
"description": "Hyper+T → þ",
"from": { "key_code": "t", "modifiers": { "mandatory": ["left_command", "left_control", "left_option"], "optional": ["any"] } },
"to": [ { "shell_command": "osascript -e 'set old to the clipboard' -e 'set the clipboard to (character id 254)' -e 'tell application \"System Events\" to keystroke \"v\" using command down' -e 'delay 0.05' -e 'set the clipboard to old'" } ]
},
{
"type": "basic",
"description": "Hyper+N → ñ",
"from": { "key_code": "n", "modifiers": { "mandatory": ["left_command", "left_control", "left_option"], "optional": ["any"] } },
"to": [ { "shell_command": "osascript -e 'set old to the clipboard' -e 'set the clipboard to (character id 241)' -e 'tell application \"System Events\" to keystroke \"v\" using command down' -e 'delay 0.05' -e 'set the clipboard to old'" } ]
},
{
"type": "basic",
"description": "Hyper+G → ŋ",
"from": { "key_code": "g", "modifiers": { "mandatory": ["left_command", "left_control", "left_option"], "optional": ["any"] } },
"to": [ { "shell_command": "osascript -e 'set old to the clipboard' -e 'set the clipboard to (character id 331)' -e 'tell application \"System Events\" to keystroke \"v\" using command down' -e 'delay 0.05' -e 'set the clipboard to old'" } ]
},
{
"type": "basic",
"description": "Hyper+. → · (middle dot)",
"from": { "key_code": "period", "modifiers": { "mandatory": ["left_command", "left_control", "left_option"], "optional": ["any"] } },
"to": [ { "shell_command": "osascript -e 'set old to the clipboard' -e 'set the clipboard to (character id 183)' -e 'tell application \"System Events\" to keystroke \"v\" using command down' -e 'delay 0.05' -e 'set the clipboard to old'" } ]
}
]
}
]
}
{
"title": "Hyperkey (Capslock replacement)",
"rules": [
{
"description": "Caps Lock acts as Hyper Key when held, Escape when tapped alone.",
"manipulators": [
{
"from": {
"key_code": "caps_lock",
"modifiers": {
"optional": [
"any"
]
}
},
"to": [
{
"key_code": "left_command",
"modifiers": [
"left_control",
"left_option"
]
}
],
"to_if_alone": [
{
"key_code": "escape"
}
],
"type": "basic"
}
]
}
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment