Skip to content

Commit 8a929f6

Browse files
authored
Fix sway+nvidia confirmation dialog (#4481) (#4485)
* Fix sway+nvidia confirmation dialog (#4481) Two bugs in the Sway+Nvidia driver confirmation: 1. The boolean was inverted - confirming "yes, I'm okay with issues" reverted the driver to the previous choice instead of keeping it. 2. The warning triggered for any Nvidia driver, including the open-source nouveau driver which is officially supported by Sway. Add GfxDriver.is_nvidia_proprietary() and is_nvidia_nouveau() methods so the warning fires only for nvidia-open-dkms (proprietary userspace). * Address review feedback (#4485) - Drop is_nvidia_nouveau() helper. It is not called anywhere yet; can be re-added when a consumer lands. - Collapse the Sway+Nvidia confirmation result handling into a single expression now that allow_skip=False guarantees a boolean answer.
1 parent e1efa34 commit 8a929f6

2 files changed

Lines changed: 15 additions & 3 deletions

File tree

archinstall/lib/hardware.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,19 @@ def is_nvidia(self) -> bool:
6868
case _:
6969
return False
7070

71+
def is_nvidia_proprietary(self) -> bool:
72+
"""
73+
True for Nvidia drivers that ship proprietary userspace components.
74+
Currently only NvidiaOpenKernel (nvidia-open-dkms): open kernel module
75+
paired with proprietary userspace. NvidiaOpenSource (nouveau) is fully
76+
open and works with Sway, so it is excluded.
77+
"""
78+
match self:
79+
case GfxDriver.NvidiaOpenKernel:
80+
return True
81+
case _:
82+
return False
83+
7184
def packages_text(self) -> str:
7285
pkg_names = [p.value for p in self.gfx_packages()]
7386
text = tr('Installed packages') + ':\n'

archinstall/lib/profile/profile_menu.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ async def _select_gfx_driver(self, preset: GfxDriver | None = None) -> GfxDriver
9595
driver = await select_driver(preset=preset)
9696

9797
if driver and 'Sway' in profile.current_selection_names():
98-
if driver.is_nvidia():
98+
if driver.is_nvidia_proprietary():
9999
header = tr('The proprietary Nvidia driver is not supported by Sway.') + '\n'
100100
header += tr('It is likely that you will run into issues, are you okay with that?') + '\n'
101101

@@ -105,8 +105,7 @@ async def _select_gfx_driver(self, preset: GfxDriver | None = None) -> GfxDriver
105105
preset=False,
106106
).show()
107107

108-
if result.get_value():
109-
return preset
108+
return driver if result.get_value() else preset
110109

111110
return driver
112111

0 commit comments

Comments
 (0)