Make audio server selection only prompt for desktop profiles

This commit is contained in:
Dylan Taylor 2021-04-07 19:51:16 -04:00
parent 75008f3f0e
commit fd7510a88c
1 changed files with 17 additions and 9 deletions

View File

@ -182,9 +182,16 @@ def ask_user_questions():
) )
exit(1) exit(1)
# Ask about audio server selection (this right now just asks for pipewire and defaults to pulseaudio otherwise) # Ask about audio server selection if one is not already set
if not archinstall.arguments.get('audio', None): 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() 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'
# Additional packages (with some light weight error handling for invalid package names) # Additional packages (with some light weight error handling for invalid package names)
if not archinstall.arguments.get('packages', None): if not archinstall.arguments.get('packages', None):
@ -334,6 +341,7 @@ def perform_installation(device, boot_partition, language, mirrors):
installation.enable_service('systemd-networkd') installation.enable_service('systemd-networkd')
installation.enable_service('systemd-resolved') installation.enable_service('systemd-resolved')
if archinstall.arguments['audio'] != 'none':
installation.log(f"The {archinstall.arguments.get('audio', None)} audio server will be used.", level=archinstall.LOG_LEVELS.Info) installation.log(f"The {archinstall.arguments.get('audio', None)} audio server will be used.", level=archinstall.LOG_LEVELS.Info)
if archinstall.arguments.get('audio', None) == 'pipewire': if archinstall.arguments.get('audio', None) == 'pipewire':
print('Installing pipewire ...') print('Installing pipewire ...')