Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/archinstall/default_profiles/applications/pipewire.py
blob: 5d2e5ea3f0512f24c7d44223d27ea8c7d7f04279 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
from typing import List, Union, Any, TYPE_CHECKING

import archinstall

from archinstall.default_profiles.profile import Profile, ProfileType
from archinstall.lib.models import User

if TYPE_CHECKING:
	from archinstall.lib.installer import Installer
	_: Any


class PipewireProfile(Profile):
	def __init__(self):
		super().__init__('Pipewire', ProfileType.Application)

	@property
	def packages(self) -> List[str]:
		return [
			'pipewire',
			'pipewire-alsa',
			'pipewire-jack',
			'pipewire-pulse',
			'gst-plugin-pipewire',
			'libpulse',
			'wireplumber'
		]

	def _enable_pipewire_for_all(self, install_session: 'Installer'):
		users: Union[User, List[User]] = archinstall.arguments.get('!users', None)
		if not isinstance(users, list):
			users = [users]

		for user in users:
			install_session.arch_chroot('systemctl enable --user pipewire-pulse.service', run_as=user.username)

	def install(self, install_session: 'Installer'):
		super().install(install_session)
		install_session.add_additional_packages(self.packages)
		self._enable_pipewire_for_all(install_session)