想要自定义Karabiner-Elements的Complex Modification,但却发现完全没有办法:
只能Import from browser,然而别人写的我必然用的有问题。后来发现,这个repo是开源的:https://github.com/pqrs-org/KE-complex_modifications
我们的目标:
- Cmd + Tab -> Ctrl + Tab
- Alt + Tab -> Cmd + Tab
- Ctrl + Tab -> Alt + Tab
根据repo上所说的,clone下来之后,整个过程分为4步:
-
Put a
.rb
(or.erb
) template file into src/json. (Or put a.json
file into public/json directly.) -
(Optional) Put extra description file into public/extra_descriptions.
-
Add the following json into public/groups.json >
files
.{ "path": "json/your_awesome_configuration.json", // required "extra_description_path": "extra_descriptions/your_awesome_configuration.html" // optional },
-
Run
make
command on Terminal.
If you've put.rb
(or.erb
) source file intosrc/json
, formatted json file will be auto generated in thepublic/json/your_awesome_configuration.json
.make
遂这样搞了一把,看着别人的写法,照葫芦画瓢整出了一个json文件:https://github.com/JeffersonQin/KE-complex_modifications/blob/master/public/json/ctrl_option_command_tab_change.json
接下来,跑一下make
, make server
看一下效果,发现一切正常。由于Karabiner-Elements不允许http协议,所以更据提示:
cp public/json/your_awesome_configuration.json ~/.config/karabiner/assets/complex_modifications
即可。最后提交一下PR来公开。