Skip to content

Stop installing xorg packages for Wayland profiles#4348

Open
dylanmtaylor wants to merge 6 commits intoarchlinux:masterfrom
dylanmtaylor:wayland-profile
Open

Stop installing xorg packages for Wayland profiles#4348
dylanmtaylor wants to merge 6 commits intoarchlinux:masterfrom
dylanmtaylor:wayland-profile

Conversation

@dylanmtaylor
Copy link
Copy Markdown
Contributor

@dylanmtaylor dylanmtaylor commented Mar 31, 2026

Wayland profiles no longer pull in xorg-server and xorg-xinit.

Adds an is_wayland property to Profile. Wayland profiles (GNOME, KDE Plasma, Cosmic, hyprland, sway, niri, river, labwc) extend Profile directly instead of XorgProfile. X11 profiles stay on XorgProfile.

@dylanmtaylor dylanmtaylor marked this pull request as ready for review March 31, 2026 22:53
@dylanmtaylor dylanmtaylor requested a review from Torxed as a code owner March 31, 2026 22:53
@dylanmtaylor
Copy link
Copy Markdown
Contributor Author

Ah, I spotted a bug.

	def __init__(
		self,
		name: str = 'Wayland',
		profile_type: ProfileType = ProfileType.Xorg,
	):

Need to fix that.

@dylanmtaylor
Copy link
Copy Markdown
Contributor Author

I still need to test this, but it's probably not too far off from correct.

@h8d13
Copy link
Copy Markdown
Contributor

h8d13 commented Mar 31, 2026

I believe you will run into one issue is that you will need to hide wayland from menu choice since it can't really be used standalone, should be hidden in /lib/profile/profiles_handler.py if I remember correctly

	def _find_available_profiles(self) -> list[Profile]:
		"""
		Search the profile path for profile definitions
		"""
		profiles_path = Path(__file__).parents[2] / 'default_profiles'
		profiles = []
		for file in profiles_path.glob('**/*.py'):
			# ignore the abstract default_profiles classes
			# and wayland standalone
			if file.name in ('profile.py', 'wayland.py'):
				continue

@dylanmtaylor
Copy link
Copy Markdown
Contributor Author

I believe you will run into one issue is that you will need to hide wayland from menu choice since it can't really be used standalone, should be hidden in /lib/profile/profiles_handler.py if I remember correctly

	def _find_available_profiles(self) -> list[Profile]:
		"""
		Search the profile path for profile definitions
		"""
		profiles_path = Path(__file__).parents[2] / 'default_profiles'
		profiles = []
		for file in profiles_path.glob('**/*.py'):
			# ignore the abstract default_profiles classes
			# and wayland standalone
			if file.name in ('profile.py', 'wayland.py'):
				continue

Ah, nice callout. I implemented the code from this comment.

@dylanmtaylor
Copy link
Copy Markdown
Contributor Author

We can remove 'xorg-xinit', from awesome since it's in the base class now.

@dylanmtaylor
Copy link
Copy Markdown
Contributor Author

Tested working with KDE.

image image

This is good to go in.

@dylanmtaylor dylanmtaylor requested a review from h8d13 April 1, 2026 00:42
Copy link
Copy Markdown
Contributor

@h8d13 h8d13 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great, and a nice gain in download/install size + unnecessary attack surface

@svartkanin
Copy link
Copy Markdown
Collaborator

@dylanmtaylor instead of using inheritance for this, can we move this to a composition pattern instead as it will make refactoring easier in the future. Also the creating a wayland profile indicates that this is a standalone profile which it isn't.
The profiles should have a property is_wayland or something.

@dylanmtaylor
Copy link
Copy Markdown
Contributor Author

@dylanmtaylor instead of using inheritance for this, can we move this to a composition pattern instead as it will make refactoring easier in the future. Also the creating a wayland profile indicates that this is a standalone profile which it isn't.
The profiles should have a property is_wayland or something.

I already have handled it not being reported as a standalone pattern in this change as it currently gets excluded from profile selection but I'll rethink the approach.

@dylanmtaylor dylanmtaylor force-pushed the wayland-profile branch 2 times, most recently from f3927ba to 99b592f Compare April 1, 2026 12:56
@dylanmtaylor
Copy link
Copy Markdown
Contributor Author

This block is now necessary for the base Xorg profile (no desktop) to install its own packages:

	@override
	def install(self, install_session: Installer) -> None:
		install_session.add_additional_packages(self.packages)

@dylanmtaylor dylanmtaylor changed the title Add WaylandProfile to avoid installing xorg packages for Wayland compositors Stop installing xorg packages for Wayland profiles Apr 1, 2026
@dylanmtaylor
Copy link
Copy Markdown
Contributor Author

This is tested (again) and still working after the refactor.

@dylanmtaylor
Copy link
Copy Markdown
Contributor Author

@svartkanin Is this closer to what you were thinking now?

@svartkanin
Copy link
Copy Markdown
Collaborator

Somewhat.
I would move the

	@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

from the XorgProfile into the Profile class as that's common for all child profiles.

Then we can change the inheritence for all profiles from

class BspwmProfile(XorgProfile):
...
class DeepinProfile(XorgProfile):
...

to

class BspwmProfile(Profile):
...
class DeepinProfile(Profile):
...

The parameter in profile can even be a enum

class DisplayServerType(Enum):
	Xorg = 'Xorg'
	Wayland = 'Wayland'


class Profile:
	def __init__(
		self,
                ...
		display_server: DisplayServerType | None = None,
	) -> None:

and set that in the profiles

class BspwmProfile(Profile):
	def __init__(self) -> None:
		super().__init__(
                        ...
			display_server=DisplayServerType.Xorg,

		)

and then the installation in https://github.com/svartkanin/archinstall/blob/dd0da34ed9b61053b7bb67c106507541f382071c/archinstall/default_profiles/desktop.py?plain=1#L94
should probably install the xorg/wayland things depending on which one is set per profile.

what do you think?

@Torxed
Copy link
Copy Markdown
Member

Torxed commented Apr 2, 2026

That looks really clean in my opinion.

@dylanmtaylor
Copy link
Copy Markdown
Contributor Author

I like it, I'm working on the change now. We do need to make sure the base xorg profile continues to install on its own.

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.
@dylanmtaylor
Copy link
Copy Markdown
Contributor Author

Alright, new updated version is ready for review. I'll do a few installation tests myself in a bit.

@dylanmtaylor
Copy link
Copy Markdown
Contributor Author

Just did a few installation tests. This seems to still work, and I like how clean it is implemented now. @Torxed / @svartkanin I think this is ready to merge in

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants