index : archinstall32 | |
Archlinux32 installer | gitolite user |
summaryrefslogtreecommitdiff |
author | Daniel <blackrabbit256@gmail.com> | 2022-02-03 00:26:09 +1100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-02-02 14:26:09 +0100 |
commit | 37d6da7e4eb8897dfb80797f28db85ccdd09d376 (patch) | |
tree | e905face839487c47a246b521bf905e47d2fb8cb /profiles | |
parent | d3cf8a3655fe258a6291c05f94c7e3cff2a91a62 (diff) |
-rw-r--r-- | profiles/sway.py | 21 |
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__) |