|
1 | 1 | from typing import override |
2 | 2 |
|
3 | | -from archinstall.default_profiles.desktops import SeatAccess |
| 3 | +from archinstall.default_profiles.desktops.utils import select_seat_access |
4 | 4 | from archinstall.default_profiles.profile import CustomSetting, DisplayServerType, GreeterType, Profile, ProfileType |
5 | | -from archinstall.lib.menu.helpers import Selection |
6 | | -from archinstall.lib.translationhandler import tr |
7 | | -from archinstall.tui.ui.menu_item import MenuItem, MenuItemGroup |
8 | | -from archinstall.tui.ui.result import ResultType |
9 | 5 |
|
10 | 6 |
|
11 | 7 | class HyprlandProfile(Profile): |
@@ -49,26 +45,8 @@ def services(self) -> list[str]: |
49 | 45 | return [pref] |
50 | 46 | return [] |
51 | 47 |
|
52 | | - async def _select_seat_access(self) -> None: |
53 | | - # need to activate seat service and add to seat group |
54 | | - header = tr('Hyprland needs access to your seat (collection of hardware devices i.e. keyboard, mouse, etc)') |
55 | | - header += '\n' + tr('Choose an option to give Hyprland access to your hardware') + '\n' |
56 | | - |
57 | | - items = [MenuItem(s.value, value=s) for s in SeatAccess] |
58 | | - group = MenuItemGroup(items, sort_items=True) |
59 | | - |
60 | | - default = self.custom_settings.get(CustomSetting.SeatAccess, None) |
61 | | - group.set_default_by_value(default) |
62 | | - |
63 | | - result = await Selection[SeatAccess]( |
64 | | - group, |
65 | | - header=header, |
66 | | - allow_skip=False, |
67 | | - ).show() |
68 | | - |
69 | | - if result.type_ == ResultType.Selection: |
70 | | - self.custom_settings[CustomSetting.SeatAccess] = result.get_value().value |
71 | | - |
72 | 48 | @override |
73 | 49 | async def do_on_select(self) -> None: |
74 | | - await self._select_seat_access() |
| 50 | + default = self.custom_settings.get(CustomSetting.SeatAccess, None) |
| 51 | + seat_access = await select_seat_access(self.name, default) |
| 52 | + self.custom_settings[CustomSetting.SeatAccess] = seat_access.value |
0 commit comments