Fix seat-access selection (#2885)

* Fix seat-access selection

* Format import
This commit is contained in:
Daniel Girtler 2024-11-20 00:50:16 +11:00 committed by GitHub
parent 69b443c1ad
commit 20cc124a6d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 16 additions and 16 deletions

View File

@ -0,0 +1,6 @@
from enum import Enum
class SeatAccess(Enum):
seatd = 'seatd'
polkit = 'polkit'

View File

@ -1,6 +1,6 @@
from enum import Enum
from typing import TYPE_CHECKING, Any
from archinstall.default_profiles.desktops import SeatAccess
from archinstall.default_profiles.profile import GreeterType, ProfileType, SelectResult
from archinstall.default_profiles.xorg import XorgProfile
from archinstall.tui import Alignment, FrameProperties, MenuItem, MenuItemGroup, ResultType, SelectMenu
@ -10,11 +10,6 @@ if TYPE_CHECKING:
_: Any
class SeatAccess(Enum):
seatd = 'seatd'
polkit = 'polkit'
class HyprlandProfile(XorgProfile):
def __init__(self) -> None:
super().__init__('Hyprland', ProfileType.DesktopEnv, description='')
@ -44,7 +39,7 @@ class HyprlandProfile(XorgProfile):
@property
def services(self) -> list[str]:
if pref := self.custom_settings.get('seat_access', None):
return [pref.value]
return [pref]
return []
def _ask_seat_access(self) -> None:
@ -68,7 +63,7 @@ class HyprlandProfile(XorgProfile):
if result.type_ == ResultType.Selection:
if result.item() is not None:
self.custom_settings['seat_access'] = result.get_value()
self.custom_settings['seat_access'] = result.get_value().value
def do_on_select(self) -> SelectResult | None:
self._ask_seat_access()

View File

@ -1,6 +1,6 @@
from enum import Enum
from typing import TYPE_CHECKING, Any
from archinstall.default_profiles.desktops import SeatAccess
from archinstall.default_profiles.profile import GreeterType, ProfileType, SelectResult
from archinstall.default_profiles.xorg import XorgProfile
from archinstall.tui import Alignment, FrameProperties, MenuItem, MenuItemGroup, ResultType, SelectMenu
@ -10,11 +10,6 @@ if TYPE_CHECKING:
_: Any
class SeatAccess(Enum):
seatd = 'seatd'
polkit = 'polkit'
class SwayProfile(XorgProfile):
def __init__(self) -> None:
super().__init__(
@ -77,7 +72,7 @@ class SwayProfile(XorgProfile):
if result.type_ == ResultType.Selection:
if result.item() is not None:
self.custom_settings['seat_access'] = result.get_value()
self.custom_settings['seat_access'] = result.get_value().value
def do_on_select(self) -> SelectResult | None:
self._ask_seat_access()

View File

@ -120,9 +120,13 @@ class ProfileHandler:
info('No profile definition found: {}'.format(', '.join(invalid_sub_profiles)))
custom_settings = profile_config.get('custom_settings', {})
profile.set_custom_settings(custom_settings)
profile.current_selection = valid_sub_profiles
for sub_profile in valid_sub_profiles:
sub_profile_settings = custom_settings.get(sub_profile.name, {})
if sub_profile_settings:
sub_profile.custom_settings = sub_profile_settings
return profile
@property