Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/archinstall/lib/user_interaction.py
diff options
context:
space:
mode:
authorAnton Hvornum <anton.feeds+github@gmail.com>2020-09-29 22:09:28 +0000
committerAnton Hvornum <anton.feeds+github@gmail.com>2020-09-29 22:09:28 +0000
commitf8963421479858ff68568f1bf492cf867e1a25aa (patch)
treedf56d30a51dbbefe8742e2886b495dc6fc349e3a /archinstall/lib/user_interaction.py
parent6338e7116ef5405cd9b97f066e45a89b7d8e67e7 (diff)
Adding a baseline xorg profile that can be called from other profiles. Such as the awesome profile, and in the future gnome and kde.
Diffstat (limited to 'archinstall/lib/user_interaction.py')
-rw-r--r--archinstall/lib/user_interaction.py27
1 files changed, 27 insertions, 0 deletions
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])