Add users to seat group when seatd is selected

When a desktop profile uses seatd for seat access, the user must be
in the seat group for the compositor to access input devices. Without
this, sway/hyprland/niri/labwc fail to start after installation.
This commit is contained in:
Softer 2026-06-06 16:08:26 +03:00
parent 23ff97c2d3
commit a31fd72f1e
5 changed files with 55 additions and 8 deletions

View File

@ -1,8 +1,12 @@
from typing import override
from typing import TYPE_CHECKING, override
from archinstall.default_profiles.desktops.utils import select_seat_access
from archinstall.default_profiles.desktops.utils import provision_seat_access, select_seat_access
from archinstall.default_profiles.profile import CustomSetting, DisplayServerType, GreeterType, Profile, ProfileType
if TYPE_CHECKING:
from archinstall.lib.installer import Installer
from archinstall.lib.models.users import User
class HyprlandProfile(Profile):
def __init__(self) -> None:
@ -45,6 +49,10 @@ class HyprlandProfile(Profile):
return [pref]
return []
@override
def provision(self, install_session: Installer, users: list[User]) -> None:
provision_seat_access(install_session, users, self.custom_settings.get(CustomSetting.SeatAccess))
@override
async def do_on_select(self) -> None:
default = self.custom_settings.get(CustomSetting.SeatAccess, None)

View File

@ -1,8 +1,12 @@
from typing import override
from typing import TYPE_CHECKING, override
from archinstall.default_profiles.desktops.utils import select_seat_access
from archinstall.default_profiles.desktops.utils import provision_seat_access, select_seat_access
from archinstall.default_profiles.profile import CustomSetting, DisplayServerType, GreeterType, Profile, ProfileType
if TYPE_CHECKING:
from archinstall.lib.installer import Installer
from archinstall.lib.models.users import User
class LabwcProfile(Profile):
def __init__(self) -> None:
@ -39,6 +43,10 @@ class LabwcProfile(Profile):
return [pref]
return []
@override
def provision(self, install_session: Installer, users: list[User]) -> None:
provision_seat_access(install_session, users, self.custom_settings.get(CustomSetting.SeatAccess))
@override
async def do_on_select(self) -> None:
default = self.custom_settings.get(CustomSetting.SeatAccess, None)

View File

@ -1,8 +1,12 @@
from typing import override
from typing import TYPE_CHECKING, override
from archinstall.default_profiles.desktops.utils import select_seat_access
from archinstall.default_profiles.desktops.utils import provision_seat_access, select_seat_access
from archinstall.default_profiles.profile import CustomSetting, DisplayServerType, GreeterType, Profile, ProfileType
if TYPE_CHECKING:
from archinstall.lib.installer import Installer
from archinstall.lib.models.users import User
class NiriProfile(Profile):
def __init__(self) -> None:
@ -47,6 +51,10 @@ class NiriProfile(Profile):
return [pref]
return []
@override
def provision(self, install_session: Installer, users: list[User]) -> None:
provision_seat_access(install_session, users, self.custom_settings.get(CustomSetting.SeatAccess))
@override
async def do_on_select(self) -> None:
default = self.custom_settings.get(CustomSetting.SeatAccess, None)

View File

@ -1,8 +1,12 @@
from typing import override
from typing import TYPE_CHECKING, override
from archinstall.default_profiles.desktops.utils import select_seat_access
from archinstall.default_profiles.desktops.utils import provision_seat_access, select_seat_access
from archinstall.default_profiles.profile import CustomSetting, DisplayServerType, GreeterType, Profile, ProfileType
if TYPE_CHECKING:
from archinstall.lib.installer import Installer
from archinstall.lib.models.users import User
class SwayProfile(Profile):
def __init__(self) -> None:
@ -49,6 +53,10 @@ class SwayProfile(Profile):
return [pref]
return []
@override
def provision(self, install_session: Installer, users: list[User]) -> None:
provision_seat_access(install_session, users, self.custom_settings.get(CustomSetting.SeatAccess))
@override
async def do_on_select(self) -> None:
default = self.custom_settings.get(CustomSetting.SeatAccess, None)

View File

@ -1,16 +1,31 @@
from enum import Enum
from typing import TYPE_CHECKING
from archinstall.lib.menu.helpers import Selection
from archinstall.lib.translationhandler import tr
from archinstall.tui.menu_item import MenuItem, MenuItemGroup
from archinstall.tui.result import ResultType
if TYPE_CHECKING:
from archinstall.lib.installer import Installer
from archinstall.lib.models.users import User
class SeatAccess(Enum):
seatd = 'seatd'
polkit = 'polkit'
def provision_seat_access(
install_session: Installer,
users: list[User],
seat_access: str | None,
) -> None:
if seat_access == SeatAccess.seatd.value:
for user in users:
install_session.arch_chroot(f'usermod -a -G seat {user.username}')
async def select_seat_access(profile_name: str, default: str | None) -> SeatAccess:
header = tr('{} needs access to your seat').format(profile_name)
header += f' ({tr("collection of hardware devices i.e. keyboard, mouse")})' + '\n'