index : archinstall32 | |
Archlinux32 installer | gitolite user |
summaryrefslogtreecommitdiff |
author | Anton Hvornum <anton@hvornum.se> | 2021-04-17 08:02:46 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-04-17 08:02:46 +0000 |
commit | 9ed29df8528688132a192959fafc0899fdca6194 (patch) | |
tree | adbc75a03ad664f03f85689d76af7a4c92fe6292 /archinstall/lib/locale_helpers.py | |
parent | e5b0468384ba70398b91c5418399b0118ece0bc5 (diff) | |
parent | c63d2140a46ee4001f855a575499cd51b7d0c0ee (diff) |
-rw-r--r-- | archinstall/lib/locale_helpers.py | 14 |
diff --git a/archinstall/lib/locale_helpers.py b/archinstall/lib/locale_helpers.py index 523a23d5..736bfc47 100644 --- a/archinstall/lib/locale_helpers.py +++ b/archinstall/lib/locale_helpers.py @@ -1,29 +1,25 @@ +import subprocess import os from .exceptions import * # from .general import sys_command -def list_keyboard_languages(layout='qwerty'): +def list_keyboard_languages(): locale_dir = '/usr/share/kbd/keymaps/' if not os.path.isdir(locale_dir): raise RequirementError(f'Directory containing locales does not exist: {locale_dir}') for root, folders, files in os.walk(locale_dir): - # Since qwerty is under /i386/ but other layouts are - # in different spots, we'll need to filter the last foldername - # of the path to verify against the desired layout. - if os.path.basename(root) != layout: - continue for file in files: if os.path.splitext(file)[1] == '.gz': yield file.strip('.gz').strip('.map') -def search_keyboard_layout(filter, layout='qwerty'): - for language in list_keyboard_languages(layout): +def search_keyboard_layout(filter): + for language in list_keyboard_languages(): if filter.lower() in language.lower(): yield language def set_keyboard_language(locale): - return os.system(f'loadkeys {locale}') == 0 + return subprocess.call(['loadkeys', locale]) == 0 |