diff options
Diffstat (limited to 'util')
-rw-r--r-- | util/lang_conv.py | 65 | ||||
-rwxr-xr-x | util/lang_gen.sh | 8 | ||||
-rwxr-xr-x | util/size_regression.sh | 1 | ||||
-rw-r--r-- | util/udev/50-qmk.rules | 3 |
4 files changed, 77 insertions, 0 deletions
diff --git a/util/lang_conv.py b/util/lang_conv.py new file mode 100644 index 0000000000..a0da6c392d --- /dev/null +++ b/util/lang_conv.py @@ -0,0 +1,65 @@ +from pathlib import Path + +langs = set() +files = Path('quantum/keymap_extras/').glob('keymap_*.h') +for file in files: + langs.add(file.stem.replace('keymap_', '')) + +for lang in langs: + try: + file = Path(f'quantum/keymap_extras/keymap_{lang}.h') + print(f'Reading:{file}') + collect = None + out = [] + out += ['{'] + out += [' "aliases": {'] + lines = file.read_text(encoding='utf-8').split('\n') + for line in lines: + + if line.startswith("// Row"): + # print(line) + continue + elif line.startswith("/*******************************************************************************"): + raise Exception(f'Skipping:{file}') + elif '/*' in line: + collect = [line] + elif '*/' in line: + collect += [line] + if 'copyright' in collect[0].lower(): + collect = None + continue + out += collect + collect = None + elif collect: + collect += [line] + + elif '#define' in line: + define = line.split() + while len(define) < 5: + define.append("") + + if define[4] == "(backslash)": + define[4] = '\\\\' + + define[4] = " ".join(define[4:]).strip() + define[4] = define[4].replace('"', '\\"') + + if define[4]: + out += [f' "{define[2]}": {{'] + out += [f' "key": "{define[1]}",'] + out += [f' "label": "{define[4]}",'] + out += [f' }}'] + else: + out += [f' "{define[2]}": {{'] + out += [f' "key": "{define[1]}"'] + out += [f' }}'] + + out += [' }'] + out += ['}'] + + dump = Path(f'data/constants/keycodes/extras/keycodes_{lang}_0.0.1.hjson') + print(f'Writing:{dump}') + dump.write_text("\n".join(out), encoding='utf-8') + + except Exception as e: + print(e) diff --git a/util/lang_gen.sh b/util/lang_gen.sh new file mode 100755 index 0000000000..0b062b1a09 --- /dev/null +++ b/util/lang_gen.sh @@ -0,0 +1,8 @@ +#!/bin/bash + +for lang in $(find data/constants/keycodes/extras/ -type f -printf "%f\n" | sed "s/keycodes_//g" | sed "s/_[0-9].*//"); do + data=$(qmk generate-keycode-extras --version latest --lang $lang) + if [ "$?" == "0" ]; then + echo "$data" > quantum/keymap_extras/keymap_$lang.h + fi +done diff --git a/util/size_regression.sh b/util/size_regression.sh index 6da2d360bb..96555c6519 100755 --- a/util/size_regression.sh +++ b/util/size_regression.sh @@ -64,6 +64,7 @@ fixup_submodules() { [ -e lib/ugfx ] && rm -rf lib/ugfx [ -e lib/pico-sdk ] && rm -rf lib/pico-sdk [ -e lib/chibios-contrib/ext/mcux-sdk ] && rm -rf lib/chibios-contrib/ext/mcux-sdk + [ -e lib/lvgl ] && rm -rf lib/lvgl make git-submodule } diff --git a/util/udev/50-qmk.rules b/util/udev/50-qmk.rules index 86f1dc9004..1cc19b4142 100644 --- a/util/udev/50-qmk.rules +++ b/util/udev/50-qmk.rules @@ -81,3 +81,6 @@ SUBSYSTEMS=="usb", ATTRS{idVendor}=="314b", ATTRS{idProduct}=="0106", TAG+="uacc # GD32V DFU SUBSYSTEMS=="usb", ATTRS{idVendor}=="28e9", ATTRS{idProduct}=="0189", TAG+="uaccess" + +# WB32 DFU +SUBSYSTEMS=="usb", ATTRS{idVendor}=="342d", ATTRS{idProduct}=="dfa0", TAG+="uaccess" |