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 --- examples/guided.py | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) (limited to 'examples/guided.py') diff --git a/examples/guided.py b/examples/guided.py index 266efbd4..647e78b1 100644 --- a/examples/guided.py +++ b/examples/guided.py @@ -7,7 +7,7 @@ import archinstall from archinstall.lib.general import run_custom_user_commands from archinstall.lib.hardware import * from archinstall.lib.networking import check_mirror_reachable -from archinstall.lib.profiles import Profile +from archinstall.lib.profiles import Profile, is_desktop_profile if archinstall.arguments.get('help'): print("See `man archinstall` for help.") @@ -212,13 +212,8 @@ def ask_user_questions(): # Ask about audio server selection if one is not already set if not archinstall.arguments.get('audio', None): - # only ask for audio server selection on a desktop profile - if str(archinstall.arguments['profile']) == 'Profile(desktop)': - archinstall.arguments['audio'] = archinstall.ask_for_audio_selection() - else: - # packages installed by a profile may depend on audio and something may get installed anyways, not much we can do about that. - # we will not try to remove packages post-installation to not have audio, as that may cause multiple issues - archinstall.arguments['audio'] = None + # The argument to ask_for_audio_selection lets the library know if it's a desktop profile + archinstall.arguments['audio'] = archinstall.ask_for_audio_selection(is_desktop_profile(archinstall.arguments['profile'])) # Ask for preferred kernel: if not archinstall.arguments.get("kernels", None): @@ -270,10 +265,10 @@ def perform_installation_steps(): with open("/var/log/archinstall/user_configuration.json", "w") as config_file: config_file.write(user_configuration) print() - + if archinstall.arguments.get('dry_run'): exit(0) - + if not archinstall.arguments.get('silent'): input('Press Enter to continue.') -- cgit v1.2.3-54-g00ecf