Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/profiles/sway.py
diff options
context:
space:
mode:
Diffstat (limited to 'profiles/sway.py')
-rw-r--r--profiles/sway.py21
1 files changed, 15 insertions, 6 deletions
diff --git a/profiles/sway.py b/profiles/sway.py
index b0ff8c19..27905e33 100644
--- a/profiles/sway.py
+++ b/profiles/sway.py
@@ -1,5 +1,4 @@
# A desktop environment using "Sway"
-
import archinstall
is_top_level_profile = False
@@ -18,6 +17,16 @@ __packages__ = [
]
+def _check_driver() -> bool:
+ if "nvidia" in archinstall.storage.get("gfx_driver_packages", None):
+ prompt = 'The proprietary Nvidia driver is not supported by Sway. It is likely that you will run into issues, are you okay with that?'
+ choice = archinstall.Menu(prompt, ['yes', 'no'], default_option='no').run()
+ if choice == 'no':
+ return False
+
+ return True
+
+
def _prep_function(*args, **kwargs):
"""
Magic function called by the importing installer
@@ -25,7 +34,9 @@ def _prep_function(*args, **kwargs):
other code in this stage. So it's a safe way to ask the user
for more input before any other installer steps start.
"""
- archinstall.storage["gfx_driver_packages"] = archinstall.select_driver()
+ archinstall.storage["gfx_driver_packages"] = archinstall.select_driver(force_ask=True)
+ if not _check_driver():
+ return _prep_function(args, kwargs)
return True
@@ -34,10 +45,8 @@ def _prep_function(*args, **kwargs):
# through importlib.util.spec_from_file_location("sway", "/somewhere/sway.py")
# or through conventional import sway
if __name__ == "sway":
- if "nvidia" in archinstall.storage.get("gfx_driver_packages", None):
- choice = input("The proprietary Nvidia driver is not supported by Sway. It is likely that you will run into issues. Continue anyways? [y/N] ")
- if choice.lower() in ("n", ""):
- raise archinstall.lib.exceptions.HardwareIncompatibilityError("Sway does not support the proprietary nvidia drivers.")
+ if not _check_driver():
+ raise archinstall.lib.exceptions.HardwareIncompatibilityError("Sway does not support the proprietary nvidia drivers.")
# Install the Sway packages
archinstall.storage['installation_session'].add_additional_packages(__packages__)