-
-
Save jostyee/c0c85fac6b726d011b658e1484146e9f to your computer and use it in GitHub Desktop.
Merge karabiner.json with complex modification rules
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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