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:
authorDaniel <blackrabbit256@gmail.com>2022-02-03 00:26:09 +1100
committerGitHub <noreply@github.com>2022-02-02 14:26:09 +0100
commit37d6da7e4eb8897dfb80797f28db85ccdd09d376 (patch)
treee905face839487c47a246b521bf905e47d2fb8cb /profiles/sway.py
parentd3cf8a3655fe258a6291c05f94c7e3cff2a91a62 (diff)
Migrate old input to new menu (#874)
* Migrate old input to new menu * Fix imports * Remove imports * Update * Fixed import by changing 'import archinstall', to 'from ..menu import Menu' and use Menu() directly * Converted archinstall.<thing> to from ..where import <thing>. This enables us to use archinstall as a module, a git repository in testing and other things without having to install archinstall as an actual module. Co-authored-by: Daniel Girtler <girtler.daniel@gmail.com> Co-authored-by: Anton Hvornum <anton@hvornum.se>
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__)