Move choice into guided installation instead of DEs

Arch wiki says packages should enable the user services automatically
This commit is contained in:
Dylan M. Taylor 2021-04-06 18:04:03 -04:00 committed by Dylan Taylor
parent 9a6c0e7a41
commit b803c281ea
8 changed files with 19 additions and 33 deletions

View File

@ -139,6 +139,14 @@ def ask_for_a_timezone():
level=LOG_LEVELS.Warning,
fg='red'
)
def ask_for_audio_selection():
audio = "pulseaudio" # Default for most desktop environments
pipewire_choice = input("Would you like to install the pipewire audio server? [Y/n] ").lower()
if pipewire_choice == "y":
audio = "pipewire"
return audio
def ask_to_configure_network():
# Optionally configure one network interface.

View File

@ -160,6 +160,10 @@ def ask_user_questions():
)
exit(1)
# Ask about audio server selection (this right now just asks for pipewire and defaults to pulseaudio otherwise)
if not archinstall.arguments.get('audio', None):
archinstall.arguments['audio'] = archinstall.ask_for_audio_selection()
# Additional packages (with some light weight error handling for invalid package names)
if not archinstall.arguments.get('packages', None):
print("Packages not part of the desktop environment are not installed by default.")
@ -278,7 +282,11 @@ def perform_installation(device, boot_partition, language, mirrors):
installation.enable_service('systemd-networkd')
installation.enable_service('systemd-resolved')
print('This audio server will be used: ' + archinstall.arguments.get('audio', None))
if archinstall.arguments.get('audio', None) == 'pipewire':
print('Installing pipewire ...')
installation.install_profile('pipewire')
if archinstall.arguments.get('packages', None) and archinstall.arguments.get('packages', None)[0] != '':
installation.add_additional_packages(archinstall.arguments.get('packages', None))

View File

@ -1,5 +1,5 @@
import archinstall
__packages__ = ["pipewire", "pipewire-alsa", "pipewire-docs", "pipewire-jack", "pipewire-media-session", "pipewire-pulse", "gst-plugin-pipewire", "libpulse"]
packages = ["pipewire", "pipewire-alsa", "pipewire-docs", "pipewire-jack", "pipewire-media-session", "pipewire-pulse", "gst-plugin-pipewire", "libpulse"]
installation.add_additional_packages(__packages__)
installation.add_additional_packages(packages)

View File

@ -29,12 +29,6 @@ def _prep_function(*args, **kwargs):
# through importlib.util.spec_from_file_location("awesome", "/somewhere/awesome.py")
# or through conventional import awesome
if __name__ == 'awesome':
# Install the pipewire audio server if the user wants to use it
pipewire_choice = input("Would you like to install the pipewire audio server? [Y/n] ").lower()
if choice == "y":
pipewire = archinstall.Application(installation, 'pipewire')
pipewire.install()
# Install the application awesome from the template under /applications/
awesome = archinstall.Application(installation, 'awesome')
awesome.install()

View File

@ -24,12 +24,6 @@ def _prep_function(*args, **kwargs):
# through importlib.util.spec_from_file_location("cinnamon", "/somewhere/cinnamon.py")
# or through conventional import cinnamon
if __name__ == 'cinnamon':
# Install the pipewire audio server if the user wants to use it
pipewire_choice = input("Would you like to install the pipewire audio server? [Y/n] ").lower()
if choice == "y":
pipewire = archinstall.Application(installation, 'pipewire')
pipewire.install()
# Install dependency profiles
installation.install_profile('xorg')

View File

@ -25,12 +25,6 @@ def _prep_function(*args, **kwargs):
# through importlib.util.spec_from_file_location("gnome", "/somewhere/gnome.py")
# or through conventional import gnome
if __name__ == 'gnome':
# Install the pipewire audio server if the user wants to use it
pipewire_choice = input("Would you like to install the pipewire audio server? [Y/n] ").lower()
if choice == "y":
pipewire = archinstall.Application(installation, 'pipewire')
pipewire.install()
# Install dependency profiles
installation.install_profile('xorg')

View File

@ -34,12 +34,6 @@ def _post_install(*args, **kwargs):
# through importlib.util.spec_from_file_location("kde", "/somewhere/kde.py")
# or through conventional import kde
if __name__ == 'kde':
# Install the pipewire audio server if the user wants to use it
pipewire_choice = input("Would you like to install the pipewire audio server? [Y/n] ").lower()
if choice == "y":
pipewire = archinstall.Application(installation, 'pipewire')
pipewire.install()
# Install dependency profiles
installation.install_profile('xorg')

View File

@ -25,12 +25,6 @@ def _prep_function(*args, **kwargs):
# through importlib.util.spec_from_file_location("xfce4", "/somewhere/xfce4.py")
# or through conventional import xfce4
if __name__ == 'xfce4':
# Install the pipewire audio server if the user wants to use it
pipewire_choice = input("Would you like to install the pipewire audio server? [Y/n] ").lower()
if choice == "y":
pipewire = archinstall.Application(installation, 'pipewire')
pipewire.install()
# Install dependency profiles
installation.install_profile('xorg')