diff options
Diffstat (limited to 'lib/python/qmk/commands.py')
-rw-r--r-- | lib/python/qmk/commands.py | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/lib/python/qmk/commands.py b/lib/python/qmk/commands.py index 4809365af3..510abffdce 100644 --- a/lib/python/qmk/commands.py +++ b/lib/python/qmk/commands.py @@ -13,6 +13,7 @@ from milc import cli import qmk.keymap from qmk.constants import KEYBOARD_OUTPUT_PREFIX +from qmk.json_schema import json_load time_fmt = '%Y-%m-%d-%H:%M:%S' @@ -191,6 +192,15 @@ def parse_configurator_json(configurator_file): """ # FIXME(skullydazed/anyone): Add validation here user_keymap = json.load(configurator_file) + orig_keyboard = user_keymap['keyboard'] + aliases = json_load(Path('data/mappings/keyboard_aliases.json')) + + if orig_keyboard in aliases: + if 'target' in aliases[orig_keyboard]: + user_keymap['keyboard'] = aliases[orig_keyboard]['target'] + + if 'layouts' in aliases[orig_keyboard] and user_keymap['layout'] in aliases[orig_keyboard]['layouts']: + user_keymap['layout'] = aliases[orig_keyboard]['layouts'][user_keymap['layout']] return user_keymap |