From f8963421479858ff68568f1bf492cf867e1a25aa Mon Sep 17 00:00:00 2001 From: Anton Hvornum Date: Tue, 29 Sep 2020 22:09:28 +0000 Subject: Adding a baseline xorg profile that can be called from other profiles. Such as the awesome profile, and in the future gnome and kde. --- archinstall/lib/user_interaction.py | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) (limited to 'archinstall/lib/user_interaction.py') diff --git a/archinstall/lib/user_interaction.py b/archinstall/lib/user_interaction.py index 9f939f12..905962c9 100644 --- a/archinstall/lib/user_interaction.py +++ b/archinstall/lib/user_interaction.py @@ -17,6 +17,33 @@ def select_disk(dict_o_disks): raise DiskError('select_disk() requires a non-empty dictionary of disks to select from.') +def select_profile(options): + profiles = sorted(list(options)) + + if len(profiles) >= 1: + for index, profile in enumerate(profiles): + print(f"{index}: {profile}") + + print(' -- The above list is pre-programmed profiles. --') + print(' -- They might make it easier to install things like desktop environments. --') + print(' -- (Leave blank to skip this next optional step) --') + selected_profile = input('Any particular pre-programmed profile you want to install: ') + + #print(' -- You can enter ? or help to search for more profiles --') + #if selected_profile.lower() in ('?', 'help'): + # filter_string = input('Search for layout containing (example: "sv-"): ') + # new_options = search_keyboard_layout(filter_string) + # return select_language(new_options) + if selected_profile.isdigit() and (pos := int(selected_profile)) <= len(profiles)-1: + selected_profile = profiles[pos] + elif selected_profile in options: + selected_profile = options[options.index(selected_profile)] + else: + RequirementError("Selected profile does not exist.") + return selected_profile + + raise RequirementError("Selecting profiles require a least one profile to be given as an option.") + def select_language(options, show_only_country_codes=True): if show_only_country_codes: languages = sorted([language for language in list(options) if len(language) == 2]) -- cgit v1.2.3-54-g00ecf