Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Merge karabiner.json with complex modification rules
#!/usr/bin/env bash
# Requirements : goku, jq
# 1. Make sure goku runs
goku
# 2. Make temp json file
cp ~/.config/karabiner/karabiner.json ~/.config/karabiner/karabiner.tmp.json
# 3. Merge karabiner.json with ~/.config/karabiner/assets/complex_modifications/enabled/*.json
# Create `enabled` folder and put your desired json in there, those files will not be shown within karabiner ui
jq -s '.[0].profiles[0].complex_modifications.rules += reduce (.[1:] | .[].rules) as $a ([]; . + $a) | .[0]' ~/.config/karabiner/karabiner.tmp.json ~/.config/karabiner/assets/complex_modifications/enabled/*.json > ~/.config/karabiner/karabiner.json
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment