Kanata provides more readable keyboard remapping configurations than Karabiner-Elements. To run it automatically on macOS startup, set it up as a LaunchDaemon.
Install Kanata via Homebrew:
| |
Download and install the Karabiner VirtualHIDDevice driver. Kanata needs this to interact with macOS.
Create your Kanata configuration at ~/.config/kanata/config.kbd. See the documentation for examples. Add a key combo to reload your configuration (command: lrld) to avoid manually restarting.
Create two .plist files in /Library/LaunchDaemons/ to launch Kanata at startup.
First, org.custom.karabiner.plist for the Karabiner driver:
| |
Next, create org.custom.kanata.plist to launch Kanata:
| |
Important: Replace /Users/YOUR_USERNAME/.config/kanata/config.kbd with your actual .kbd file path. To find the correct Kanata binary path, run which kanata in your terminal.
Load both daemons with these commands:
| |
Kanata should start running in the background within a few seconds. It will now launch automatically on every boot.
Stop Kanata with sudo launchctl unload /Library/LaunchDaemons/org.custom.kanata.plist. Emergency escape: press Left Control + Space + Escape at their original positions.
Credit:
- Setup based on configuration shared by u/matklad on Reddit