Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions archinstall/default_profiles/desktops/hyprland.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from typing import override

from archinstall.default_profiles.desktops.utils import select_seat_access
from archinstall.default_profiles.desktops.utils import seat_access_services, select_seat_access
from archinstall.default_profiles.profile import CustomSetting, DisplayServerType, GreeterType, Profile, ProfileType


Expand Down Expand Up @@ -41,9 +41,7 @@ def default_greeter_type(self) -> GreeterType:
@property
@override
def services(self) -> list[str]:
if pref := self.custom_settings.get(CustomSetting.SeatAccess, None):
return [pref]
return []
return seat_access_services(self.custom_settings.get(CustomSetting.SeatAccess))

@override
async def do_on_select(self) -> None:
Expand Down
12 changes: 3 additions & 9 deletions archinstall/default_profiles/desktops/labwc.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from typing import override

from archinstall.default_profiles.desktops.utils import select_seat_access
from archinstall.default_profiles.desktops.utils import seat_access_packages, seat_access_services, select_seat_access
from archinstall.default_profiles.profile import CustomSetting, DisplayServerType, GreeterType, Profile, ProfileType


Expand All @@ -18,14 +18,10 @@ def __init__(self) -> None:
@property
@override
def packages(self) -> list[str]:
additional = []
if seat := self.custom_settings.get(CustomSetting.SeatAccess, None):
additional = [seat]

return [
'alacritty',
'labwc',
] + additional
] + seat_access_packages(self.custom_settings.get(CustomSetting.SeatAccess))

@property
@override
Expand All @@ -35,9 +31,7 @@ def default_greeter_type(self) -> GreeterType:
@property
@override
def services(self) -> list[str]:
if pref := self.custom_settings.get(CustomSetting.SeatAccess, None):
return [pref]
return []
return seat_access_services(self.custom_settings.get(CustomSetting.SeatAccess))

@override
async def do_on_select(self) -> None:
Expand Down
12 changes: 3 additions & 9 deletions archinstall/default_profiles/desktops/niri.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from typing import override

from archinstall.default_profiles.desktops.utils import select_seat_access
from archinstall.default_profiles.desktops.utils import seat_access_packages, seat_access_services, select_seat_access
from archinstall.default_profiles.profile import CustomSetting, DisplayServerType, GreeterType, Profile, ProfileType


Expand All @@ -18,10 +18,6 @@ def __init__(self) -> None:
@property
@override
def packages(self) -> list[str]:
additional = []
if seat := self.custom_settings.get(CustomSetting.SeatAccess, None):
additional = [seat]

return [
'niri',
'alacritty',
Expand All @@ -33,7 +29,7 @@ def packages(self) -> list[str]:
'swayidle',
'swaylock',
'xdg-desktop-portal-gnome',
] + additional
] + seat_access_packages(self.custom_settings.get(CustomSetting.SeatAccess))

@property
@override
Expand All @@ -43,9 +39,7 @@ def default_greeter_type(self) -> GreeterType:
@property
@override
def services(self) -> list[str]:
if pref := self.custom_settings.get(CustomSetting.SeatAccess, None):
return [pref]
return []
return seat_access_services(self.custom_settings.get(CustomSetting.SeatAccess))

@override
async def do_on_select(self) -> None:
Expand Down
12 changes: 3 additions & 9 deletions archinstall/default_profiles/desktops/sway.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from typing import override

from archinstall.default_profiles.desktops.utils import select_seat_access
from archinstall.default_profiles.desktops.utils import seat_access_packages, seat_access_services, select_seat_access
from archinstall.default_profiles.profile import CustomSetting, DisplayServerType, GreeterType, Profile, ProfileType


Expand All @@ -18,10 +18,6 @@ def __init__(self) -> None:
@property
@override
def packages(self) -> list[str]:
additional = []
if seat := self.custom_settings.get(CustomSetting.SeatAccess, None):
additional = [seat]

return [
'sway',
'swaybg',
Expand All @@ -35,7 +31,7 @@ def packages(self) -> list[str]:
'pavucontrol',
'foot',
'xorg-xwayland',
] + additional
] + seat_access_packages(self.custom_settings.get(CustomSetting.SeatAccess))

@property
@override
Expand All @@ -45,9 +41,7 @@ def default_greeter_type(self) -> GreeterType:
@property
@override
def services(self) -> list[str]:
if pref := self.custom_settings.get(CustomSetting.SeatAccess, None):
return [pref]
return []
return seat_access_services(self.custom_settings.get(CustomSetting.SeatAccess))

@override
async def do_on_select(self) -> None:
Expand Down
18 changes: 17 additions & 1 deletion archinstall/default_profiles/desktops/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,23 @@

class SeatAccess(Enum):
seatd = 'seatd'
polkit = 'polkit'
systemd_logind = 'systemd-logind'


# Arch builds systemd with polkit support, logind depends on it
def seat_access_packages(seat_access: str | None) -> list[str]:
if seat_access == SeatAccess.seatd.value:
return ['seatd']
if seat_access == SeatAccess.systemd_logind.value:
return ['polkit']
return []


# polkit.service is static (dbus activated), only seatd needs enabling
def seat_access_services(seat_access: str | None) -> list[str]:
if seat_access == SeatAccess.seatd.value:
return ['seatd']
return []


def provision_seat_access(
Expand Down
2 changes: 1 addition & 1 deletion tests/data/test_config.json
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@
"profile": {
"custom_settings": {
"Hyprland": {
"seat_access": "polkit"
"seat_access": "systemd-logind"
},
"Sway": {
"seat_access": "seatd"
Expand Down
2 changes: 1 addition & 1 deletion tests/test_args.py
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ def test_config_file_parsing(
{
'custom_settings': {
'Hyprland': {
CustomSetting.SeatAccess: 'polkit',
CustomSetting.SeatAccess: 'systemd-logind',
},
'Sway': {
CustomSetting.SeatAccess: 'seatd',
Expand Down