Skip to content

Stop installing xorg packages for Wayland profiles#4348

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

Stop installing xorg packages for Wayland profiles#4348
dylanmtaylor wants to merge 4 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?

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.

3 participants