Stop installing xorg packages for Wayland profiles (#4348)

* Add WaylandProfile to avoid installing xorg packages for Wayland compositors

* Refactor: use composition (is_wayland) instead of WaylandProfile inheritance

* Fix X11 profiles to inherit xorg packages from XorgProfile

* Style: use consistent multi-line super().__init__ for Wayland profiles

* Refactor: replace is_wayland with DisplayServerType enum

Add DisplayServerType enum (Xorg/Wayland) to Profile. All profiles
now inherit Profile directly with an explicit display_server param.
desktop.py installs xorg-server and xorg-xinit for Xorg profiles.
XorgProfile remains for standalone Xorg selection.

* Remove unnecessary super().packages from desktop profiles
This commit is contained in:
Dylan M. Taylor 2026-04-02 18:38:02 -04:00 committed by GitHub
parent 6c9f66265a
commit 6c6c8d8000
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
26 changed files with 198 additions and 101 deletions

View File

@ -2,7 +2,7 @@ from __future__ import annotations
from typing import TYPE_CHECKING, Self, override
from archinstall.default_profiles.profile import GreeterType, Profile, ProfileType, SelectResult
from archinstall.default_profiles.profile import DisplayServerType, GreeterType, Profile, ProfileType, SelectResult
from archinstall.lib.menu.helpers import Selection
from archinstall.lib.output import info
from archinstall.lib.profile.profiles_handler import profile_handler
@ -95,10 +95,16 @@ class DesktopProfile(Profile):
# Install common packages for all desktop environments
install_session.add_additional_packages(self.packages)
xorg_installed = False
for profile in self.current_selection:
info(f'Installing profile {profile.name}...')
install_session.add_additional_packages(profile.packages)
install_session.enable_service(profile.services)
if not xorg_installed and profile.display_server == DisplayServerType.Xorg:
install_session.add_additional_packages(['xorg-server', 'xorg-xinit'])
xorg_installed = True
profile.install(install_session)

View File

@ -2,24 +2,27 @@ from __future__ import annotations
from typing import TYPE_CHECKING, override
from archinstall.default_profiles.profile import ProfileType
from archinstall.default_profiles.xorg import XorgProfile
from archinstall.default_profiles.profile import DisplayServerType, Profile, ProfileType
if TYPE_CHECKING:
from archinstall.lib.installer import Installer
class AwesomeProfile(XorgProfile):
class AwesomeProfile(Profile):
def __init__(self) -> None:
super().__init__('Awesome', ProfileType.WindowMgr)
super().__init__(
'Awesome',
ProfileType.WindowMgr,
support_gfx_driver=True,
display_server=DisplayServerType.Xorg,
)
@property
@override
def packages(self) -> list[str]:
return super().packages + [
return [
'awesome',
'alacritty',
'xorg-xinit',
'xorg-xrandr',
'xterm',
'feh',

View File

@ -1,17 +1,20 @@
from typing import override
from archinstall.default_profiles.profile import GreeterType, ProfileType
from archinstall.default_profiles.xorg import XorgProfile
from archinstall.default_profiles.profile import DisplayServerType, GreeterType, Profile, ProfileType
class BspwmProfile(XorgProfile):
class BspwmProfile(Profile):
def __init__(self) -> None:
super().__init__('Bspwm', ProfileType.WindowMgr)
super().__init__(
'Bspwm',
ProfileType.WindowMgr,
support_gfx_driver=True,
display_server=DisplayServerType.Xorg,
)
@property
@override
def packages(self) -> list[str]:
# return super().packages + [
return [
'bspwm',
'sxhkd',

View File

@ -1,12 +1,16 @@
from typing import override
from archinstall.default_profiles.profile import GreeterType, ProfileType
from archinstall.default_profiles.xorg import XorgProfile
from archinstall.default_profiles.profile import DisplayServerType, GreeterType, Profile, ProfileType
class BudgieProfile(XorgProfile):
class BudgieProfile(Profile):
def __init__(self) -> None:
super().__init__('Budgie', ProfileType.DesktopEnv)
super().__init__(
'Budgie',
ProfileType.DesktopEnv,
support_gfx_driver=True,
display_server=DisplayServerType.Xorg,
)
@property
@override

View File

@ -1,12 +1,16 @@
from typing import override
from archinstall.default_profiles.profile import GreeterType, ProfileType
from archinstall.default_profiles.xorg import XorgProfile
from archinstall.default_profiles.profile import DisplayServerType, GreeterType, Profile, ProfileType
class CinnamonProfile(XorgProfile):
class CinnamonProfile(Profile):
def __init__(self) -> None:
super().__init__('Cinnamon', ProfileType.DesktopEnv)
super().__init__(
'Cinnamon',
ProfileType.DesktopEnv,
support_gfx_driver=True,
display_server=DisplayServerType.Xorg,
)
@property
@override

View File

@ -1,12 +1,16 @@
from typing import override
from archinstall.default_profiles.profile import GreeterType, ProfileType
from archinstall.default_profiles.xorg import XorgProfile
from archinstall.default_profiles.profile import DisplayServerType, GreeterType, Profile, ProfileType
class CosmicProfile(XorgProfile):
class CosmicProfile(Profile):
def __init__(self) -> None:
super().__init__('Cosmic', ProfileType.DesktopEnv)
super().__init__(
'Cosmic',
ProfileType.DesktopEnv,
support_gfx_driver=True,
display_server=DisplayServerType.Wayland,
)
@property
@override

View File

@ -1,12 +1,16 @@
from typing import override
from archinstall.default_profiles.profile import GreeterType, ProfileType
from archinstall.default_profiles.xorg import XorgProfile
from archinstall.default_profiles.profile import DisplayServerType, GreeterType, Profile, ProfileType
class CutefishProfile(XorgProfile):
class CutefishProfile(Profile):
def __init__(self) -> None:
super().__init__('Cutefish', ProfileType.DesktopEnv)
super().__init__(
'Cutefish',
ProfileType.DesktopEnv,
support_gfx_driver=True,
display_server=DisplayServerType.Xorg,
)
@property
@override

View File

@ -1,12 +1,16 @@
from typing import override
from archinstall.default_profiles.profile import GreeterType, ProfileType
from archinstall.default_profiles.xorg import XorgProfile
from archinstall.default_profiles.profile import DisplayServerType, GreeterType, Profile, ProfileType
class DeepinProfile(XorgProfile):
class DeepinProfile(Profile):
def __init__(self) -> None:
super().__init__('Deepin', ProfileType.DesktopEnv)
super().__init__(
'Deepin',
ProfileType.DesktopEnv,
support_gfx_driver=True,
display_server=DisplayServerType.Xorg,
)
@property
@override

View File

@ -1,12 +1,16 @@
from typing import override
from archinstall.default_profiles.profile import GreeterType, ProfileType
from archinstall.default_profiles.xorg import XorgProfile
from archinstall.default_profiles.profile import DisplayServerType, GreeterType, Profile, ProfileType
class EnlightenmentProfile(XorgProfile):
class EnlightenmentProfile(Profile):
def __init__(self) -> None:
super().__init__('Enlightenment', ProfileType.WindowMgr)
super().__init__(
'Enlightenment',
ProfileType.WindowMgr,
support_gfx_driver=True,
display_server=DisplayServerType.Xorg,
)
@property
@override

View File

@ -1,12 +1,16 @@
from typing import override
from archinstall.default_profiles.profile import GreeterType, ProfileType
from archinstall.default_profiles.xorg import XorgProfile
from archinstall.default_profiles.profile import DisplayServerType, GreeterType, Profile, ProfileType
class GnomeProfile(XorgProfile):
class GnomeProfile(Profile):
def __init__(self) -> None:
super().__init__('GNOME', ProfileType.DesktopEnv)
super().__init__(
'GNOME',
ProfileType.DesktopEnv,
support_gfx_driver=True,
display_server=DisplayServerType.Wayland,
)
@property
@override

View File

@ -1,17 +1,21 @@
from typing import override
from archinstall.default_profiles.desktops import SeatAccess
from archinstall.default_profiles.profile import GreeterType, ProfileType
from archinstall.default_profiles.xorg import XorgProfile
from archinstall.default_profiles.profile import DisplayServerType, GreeterType, Profile, ProfileType
from archinstall.lib.menu.helpers import Selection
from archinstall.lib.translationhandler import tr
from archinstall.tui.ui.menu_item import MenuItem, MenuItemGroup
from archinstall.tui.ui.result import ResultType
class HyprlandProfile(XorgProfile):
class HyprlandProfile(Profile):
def __init__(self) -> None:
super().__init__('Hyprland', ProfileType.DesktopEnv)
super().__init__(
'Hyprland',
ProfileType.DesktopEnv,
support_gfx_driver=True,
display_server=DisplayServerType.Wayland,
)
self.custom_settings = {'seat_access': None}

View File

@ -1,12 +1,16 @@
from typing import override
from archinstall.default_profiles.profile import GreeterType, ProfileType
from archinstall.default_profiles.xorg import XorgProfile
from archinstall.default_profiles.profile import DisplayServerType, GreeterType, Profile, ProfileType
class I3wmProfile(XorgProfile):
class I3wmProfile(Profile):
def __init__(self) -> None:
super().__init__('i3-wm', ProfileType.WindowMgr)
super().__init__(
'i3-wm',
ProfileType.WindowMgr,
support_gfx_driver=True,
display_server=DisplayServerType.Xorg,
)
@property
@override

View File

@ -1,19 +1,20 @@
from typing import override
from archinstall.default_profiles.desktops import SeatAccess
from archinstall.default_profiles.profile import GreeterType, ProfileType
from archinstall.default_profiles.xorg import XorgProfile
from archinstall.default_profiles.profile import DisplayServerType, GreeterType, Profile, ProfileType
from archinstall.lib.menu.helpers import Selection
from archinstall.lib.translationhandler import tr
from archinstall.tui.ui.menu_item import MenuItem, MenuItemGroup
from archinstall.tui.ui.result import ResultType
class LabwcProfile(XorgProfile):
class LabwcProfile(Profile):
def __init__(self) -> None:
super().__init__(
'Labwc',
ProfileType.WindowMgr,
support_gfx_driver=True,
display_server=DisplayServerType.Wayland,
)
self.custom_settings = {'seat_access': None}

View File

@ -1,12 +1,16 @@
from typing import override
from archinstall.default_profiles.profile import GreeterType, ProfileType
from archinstall.default_profiles.xorg import XorgProfile
from archinstall.default_profiles.profile import DisplayServerType, GreeterType, Profile, ProfileType
class LxqtProfile(XorgProfile):
class LxqtProfile(Profile):
def __init__(self) -> None:
super().__init__('Lxqt', ProfileType.DesktopEnv)
super().__init__(
'Lxqt',
ProfileType.DesktopEnv,
support_gfx_driver=True,
display_server=DisplayServerType.Xorg,
)
# NOTE: SDDM is the only officially supported greeter for LXQt, so unlike other DEs, lightdm is not used here.
# LXQt works with lightdm, but since this is not supported, we will not default to this.

View File

@ -1,12 +1,16 @@
from typing import override
from archinstall.default_profiles.profile import GreeterType, ProfileType
from archinstall.default_profiles.xorg import XorgProfile
from archinstall.default_profiles.profile import DisplayServerType, GreeterType, Profile, ProfileType
class MateProfile(XorgProfile):
class MateProfile(Profile):
def __init__(self) -> None:
super().__init__('Mate', ProfileType.DesktopEnv)
super().__init__(
'Mate',
ProfileType.DesktopEnv,
support_gfx_driver=True,
display_server=DisplayServerType.Xorg,
)
@property
@override

View File

@ -1,19 +1,20 @@
from typing import override
from archinstall.default_profiles.desktops import SeatAccess
from archinstall.default_profiles.profile import GreeterType, ProfileType
from archinstall.default_profiles.xorg import XorgProfile
from archinstall.default_profiles.profile import DisplayServerType, GreeterType, Profile, ProfileType
from archinstall.lib.menu.helpers import Selection
from archinstall.lib.translationhandler import tr
from archinstall.tui.ui.menu_item import MenuItem, MenuItemGroup
from archinstall.tui.ui.result import ResultType
class NiriProfile(XorgProfile):
class NiriProfile(Profile):
def __init__(self) -> None:
super().__init__(
'Niri',
ProfileType.WindowMgr,
support_gfx_driver=True,
display_server=DisplayServerType.Wayland,
)
self.custom_settings = {'seat_access': None}

View File

@ -1,12 +1,16 @@
from typing import override
from archinstall.default_profiles.profile import GreeterType, ProfileType
from archinstall.default_profiles.xorg import XorgProfile
from archinstall.default_profiles.profile import DisplayServerType, GreeterType, Profile, ProfileType
class PlasmaProfile(XorgProfile):
class PlasmaProfile(Profile):
def __init__(self) -> None:
super().__init__('KDE Plasma', ProfileType.DesktopEnv)
super().__init__(
'KDE Plasma',
ProfileType.DesktopEnv,
support_gfx_driver=True,
display_server=DisplayServerType.Wayland,
)
@property
@override

View File

@ -1,12 +1,16 @@
from typing import override
from archinstall.default_profiles.profile import GreeterType, ProfileType
from archinstall.default_profiles.xorg import XorgProfile
from archinstall.default_profiles.profile import DisplayServerType, GreeterType, Profile, ProfileType
class QtileProfile(XorgProfile):
class QtileProfile(Profile):
def __init__(self) -> None:
super().__init__('Qtile', ProfileType.WindowMgr)
super().__init__(
'Qtile',
ProfileType.WindowMgr,
support_gfx_driver=True,
display_server=DisplayServerType.Xorg,
)
@property
@override

View File

@ -1,12 +1,16 @@
from typing import override
from archinstall.default_profiles.profile import GreeterType, ProfileType
from archinstall.default_profiles.xorg import XorgProfile
from archinstall.default_profiles.profile import DisplayServerType, GreeterType, Profile, ProfileType
class RiverProfile(XorgProfile):
class RiverProfile(Profile):
def __init__(self) -> None:
super().__init__('River', ProfileType.WindowMgr)
super().__init__(
'River',
ProfileType.WindowMgr,
support_gfx_driver=True,
display_server=DisplayServerType.Wayland,
)
@property
@override

View File

@ -1,19 +1,20 @@
from typing import override
from archinstall.default_profiles.desktops import SeatAccess
from archinstall.default_profiles.profile import GreeterType, ProfileType
from archinstall.default_profiles.xorg import XorgProfile
from archinstall.default_profiles.profile import DisplayServerType, GreeterType, Profile, ProfileType
from archinstall.lib.menu.helpers import Selection
from archinstall.lib.translationhandler import tr
from archinstall.tui.ui.menu_item import MenuItem, MenuItemGroup
from archinstall.tui.ui.result import ResultType
class SwayProfile(XorgProfile):
class SwayProfile(Profile):
def __init__(self) -> None:
super().__init__(
'Sway',
ProfileType.WindowMgr,
support_gfx_driver=True,
display_server=DisplayServerType.Wayland,
)
self.custom_settings = {'seat_access': None}

View File

@ -1,12 +1,16 @@
from typing import override
from archinstall.default_profiles.profile import GreeterType, ProfileType
from archinstall.default_profiles.xorg import XorgProfile
from archinstall.default_profiles.profile import DisplayServerType, GreeterType, Profile, ProfileType
class Xfce4Profile(XorgProfile):
class Xfce4Profile(Profile):
def __init__(self) -> None:
super().__init__('Xfce4', ProfileType.DesktopEnv)
super().__init__(
'Xfce4',
ProfileType.DesktopEnv,
support_gfx_driver=True,
display_server=DisplayServerType.Xorg,
)
@property
@override

View File

@ -1,12 +1,16 @@
from typing import override
from archinstall.default_profiles.profile import GreeterType, ProfileType
from archinstall.default_profiles.xorg import XorgProfile
from archinstall.default_profiles.profile import DisplayServerType, GreeterType, Profile, ProfileType
class XmonadProfile(XorgProfile):
class XmonadProfile(Profile):
def __init__(self) -> None:
super().__init__('Xmonad', ProfileType.WindowMgr)
super().__init__(
'Xmonad',
ProfileType.WindowMgr,
support_gfx_driver=True,
display_server=DisplayServerType.Xorg,
)
@property
@override

View File

@ -10,6 +10,11 @@ if TYPE_CHECKING:
from archinstall.lib.models.users import User
class DisplayServerType(Enum):
Xorg = 'Xorg'
Wayland = 'Wayland'
class ProfileType(Enum):
# top level default_profiles
Server = 'Server'
@ -52,6 +57,7 @@ class Profile:
services: list[str] = [],
support_gfx_driver: bool = False,
support_greeter: bool = False,
display_server: DisplayServerType | None = None,
) -> None:
self.name = name
self.profile_type = profile_type
@ -59,6 +65,7 @@ class Profile:
self._support_gfx_driver = support_gfx_driver
self._support_greeter = support_greeter
self._display_server = display_server
# self.gfx_driver: str | None = None
@ -169,10 +176,23 @@ class Profile:
def is_greeter_supported(self) -> bool:
return self._support_greeter
@property
def display_server(self) -> DisplayServerType | None:
return self._display_server
def preview_text(self) -> str:
"""
Override this method to provide a preview text for the profile
"""
if self.is_desktop_type_profile():
if self._display_server:
text = tr('Environment type: {} {}').format(self._display_server.value, self.profile_type.value)
else:
text = tr('Environment type: {}').format(self.profile_type.value)
if packages := self.packages_text():
text += f'\n{packages}'
return text
return self.packages_text()
def packages_text(self, include_sub_packages: bool = False) -> str:

View File

@ -1,7 +1,9 @@
from typing import override
from typing import TYPE_CHECKING, override
from archinstall.default_profiles.profile import Profile, ProfileType
from archinstall.lib.translationhandler import tr
from archinstall.default_profiles.profile import DisplayServerType, Profile, ProfileType
if TYPE_CHECKING:
from archinstall.lib.installer import Installer
class XorgProfile(Profile):
@ -14,19 +16,17 @@ class XorgProfile(Profile):
name,
profile_type,
support_gfx_driver=True,
display_server=DisplayServerType.Xorg,
)
@override
def preview_text(self) -> str:
text = tr('Environment type: {}').format(self.profile_type.value)
if packages := self.packages_text():
text += f'\n{packages}'
return text
@property
@override
def packages(self) -> list[str]:
return [
'xorg-server',
'xorg-xinit',
]
@override
def install(self, install_session: Installer) -> None:
install_session.add_additional_packages(self.packages)

View File

@ -51,8 +51,6 @@ class GfxPackage(Enum):
Xf86VideoAmdgpu = 'xf86-video-amdgpu'
Xf86VideoAti = 'xf86-video-ati'
Xf86VideoNouveau = 'xf86-video-nouveau'
XorgServer = 'xorg-server'
XorgXinit = 'xorg-xinit'
class GfxDriver(Enum):
@ -80,7 +78,7 @@ class GfxDriver(Enum):
return text
def gfx_packages(self) -> list[GfxPackage]:
packages = [GfxPackage.XorgServer, GfxPackage.XorgXinit]
packages: list[GfxPackage] = []
match self:
case GfxDriver.AllOpenSource:

View File

@ -349,8 +349,8 @@ class ProfileHandler:
profiles_path = Path(__file__).parents[2] / 'default_profiles'
profiles = []
for file in profiles_path.glob('**/*.py'):
# ignore the abstract default_profiles class
if 'profile.py' in file.name:
# ignore the abstract base classes
if file.name == 'profile.py':
continue
profiles += self._process_profile_file(file)