Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDylan M. Taylor <dylan@dylanmtaylor.com>2021-04-06 18:04:03 -0400
committerDylan Taylor <dylan@dylanmtaylor.com>2021-04-09 11:46:24 -0400
commitb803c281ea98f71842c7598e428832eaf4a24584 (patch)
tree6013e70e00d939f7ebc99d5cfd41ce48aae3512b
parent9a6c0e7a41c597d7188c3028a1baaac8f4aa64a9 (diff)
Move choice into guided installation instead of DEs
Arch wiki says packages should enable the user services automatically
-rw-r--r--archinstall/lib/user_interaction.py8
-rw-r--r--examples/guided.py10
-rw-r--r--profiles/applications/pipewire.py4
-rw-r--r--profiles/awesome.py6
-rw-r--r--profiles/cinnamon.py6
-rw-r--r--profiles/gnome.py6
-rw-r--r--profiles/kde.py6
-rw-r--r--profiles/xfce4.py6
8 files changed, 19 insertions, 33 deletions
diff --git a/archinstall/lib/user_interaction.py b/archinstall/lib/user_interaction.py
index 1f5924e4..8062f6e3 100644
--- a/archinstall/lib/user_interaction.py
+++ b/archinstall/lib/user_interaction.py
@@ -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.
diff --git a/examples/guided.py b/examples/guided.py
index 6feebd00..77b64450 100644
--- a/examples/guided.py
+++ b/examples/guided.py
@@ -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))
diff --git a/profiles/applications/pipewire.py b/profiles/applications/pipewire.py
index 2d9f6a6c..aea5b50d 100644
--- a/profiles/applications/pipewire.py
+++ b/profiles/applications/pipewire.py
@@ -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)
diff --git a/profiles/awesome.py b/profiles/awesome.py
index 0bcdfc59..0b00a424 100644
--- a/profiles/awesome.py
+++ b/profiles/awesome.py
@@ -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()
diff --git a/profiles/cinnamon.py b/profiles/cinnamon.py
index 0c4f13d1..91a59811 100644
--- a/profiles/cinnamon.py
+++ b/profiles/cinnamon.py
@@ -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')
diff --git a/profiles/gnome.py b/profiles/gnome.py
index 018ea821..2e26350a 100644
--- a/profiles/gnome.py
+++ b/profiles/gnome.py
@@ -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')
diff --git a/profiles/kde.py b/profiles/kde.py
index a472394a..6654dfa7 100644
--- a/profiles/kde.py
+++ b/profiles/kde.py
@@ -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')
diff --git a/profiles/xfce4.py b/profiles/xfce4.py
index ae318317..fee8c37a 100644
--- a/profiles/xfce4.py
+++ b/profiles/xfce4.py
@@ -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')