2 of 131 min

Karabiner = a set of JSON rules

Karabiner = a set of JSON rules: illustration 1

All the “magic” of Karabiner lives as separate JSON files located at:

/User/.config/karabiner/assets/complex_modifications

This is the folder for so-called Complex Modifications:

each .json file describes one rule or a set of rules.

How it works in reality

  1. I add a new .json to this folder.

  2. Karabiner picks it up as a “modification” that can be enabled.

  3. Then: Karabiner → Complex Modifications → Add rule, and I simply enable the rule I need.

I keep the system modular:

  • one file = one idea
  • rules can be quickly switched on and off, tested and rolled back
  • it’s easy to move to another Mac and keep in git

In effect Karabiner is an “input compiler”: I describe rules in JSON and it reliably turns physical keys into the signals I need.

Next I’ll show a few of my Karabiner modifications, which I built for my workflow and brought to the point of working on autopilot.

Series contents
  1. Keyboard layers
  2. Karabiner = a set of JSON rules
  3. 1) Caps Lock = Hyper
  4. 2) A layer on Space: tap = space, hold = F18
  5. 3) backtick hold = F17
  6. 4) Russian layout: targeted rules for Russian typing only
  7. Hammerspoon
  8. Window Manager in Hammerspoon
  9. Media control as scenarios in Hammerspoon
  10. Hammerspoon as a local server and a "remote control"
  11. Monitors and a stable workplace (Hammerspoon)
  12. A MIDI keyboard and OBS as a hardware controller (Hammerspoon)
  13. The topic of keyboard layers is closed for now