1
0
mirror of https://github.com/AvengeMedia/DankMaterialShell.git synced 2026-08-01 19:18:28 -04:00

keyboard layout: add support for sway

fixes #1681
This commit is contained in:
bbedward
2026-07-04 22:55:29 -04:00
parent 74d220767d
commit 3df801e3b2
2 changed files with 47 additions and 3 deletions
+11 -2
View File
@@ -18,9 +18,18 @@ ROOT_DIR = SCRIPT_DIR.parent
FREEZE_FILE = SCRIPT_DIR / 'term_freeze.json'
# dms-plugins is a separate checkout with its own release cadence; the freeze
# only guards this repo's terms. Catalog extraction still includes plugins.
def shell_terms(translations):
return {
term: info for term, info in translations.items()
if any(not occ['file'].startswith('dms-plugins/') for occ in info['occurrences'])
}
def main():
if '--update' in sys.argv:
translations = extract_qstr_strings(ROOT_DIR)
translations = shell_terms(extract_qstr_strings(ROOT_DIR))
FREEZE_FILE.write_text(json.dumps(sorted(translations), indent=2, ensure_ascii=False) + '\n', encoding='utf-8')
print(f"Froze {len(translations)} terms to {FREEZE_FILE}")
return 0
@@ -30,7 +39,7 @@ def main():
return 0
frozen = set(json.loads(FREEZE_FILE.read_text(encoding='utf-8')))
translations = extract_qstr_strings(ROOT_DIR)
translations = shell_terms(extract_qstr_strings(ROOT_DIR))
new_terms = sorted(term for term in translations if term not in frozen)
if not new_terms:
return 0