From 4e17355796b257ea6af306f6b3af3e8fb78f94e4 Mon Sep 17 00:00:00 2001 From: "Dylan M. Taylor" Date: Sun, 13 Jun 2021 08:32:38 -0400 Subject: Implement is_desktop_profile helper function (#575) * Implement is_desktop_profile helper function * Make ask_for_audio_selection use generic_select * Fix default value for audio selection * Leverage list of supported desktops to perform is_desktop_profile check * is_desktop_profile was missing a default return value * Store return value for audio server --- archinstall/lib/user_interaction.py | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'archinstall/lib/user_interaction.py') diff --git a/archinstall/lib/user_interaction.py b/archinstall/lib/user_interaction.py index b8e1c35c..6ef70aa2 100644 --- a/archinstall/lib/user_interaction.py +++ b/archinstall/lib/user_interaction.py @@ -372,11 +372,12 @@ def ask_for_bootloader() -> str: return bootloader -def ask_for_audio_selection(): - audio = "pulseaudio" # Default for most desktop environments - pipewire_choice = input("Would you like to install pipewire instead of pulseaudio as the default audio server? [Y/n] ").lower() - if pipewire_choice in ("y", ""): - audio = "pipewire" +def ask_for_audio_selection(desktop=True): + audio = 'pipewire' if desktop else 'none' + choices = ['pipewire', 'pulseaudio'] if desktop else ['pipewire', 'pulseaudio', 'none'] + selection = generic_select(choices, f'Choose an audio server or leave blank to use {audio}: ', options_output=True) + if selection != "": + audio = selection return audio @@ -703,7 +704,7 @@ def select_driver(options=AVAILABLE_GFX_DRIVERS): if drivers: if has_amd_graphics(): - print('For the best compatibility with your AMD hardware, you may want to use either the all open-source or AMD / ATI options.') + print('For the best compatibility with your AMD hardware, you may want to use either the all open-source or AMD / ATI options.') if has_intel_graphics(): print('For the best compatibility with your Intel hardware, you may want to use either the all open-source or Intel options.') if has_nvidia_graphics(): -- cgit v1.2.3-70-g09d2