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:
parent
6c9f66265a
commit
6c6c8d8000
|
|
@ -2,7 +2,7 @@ from __future__ import annotations
|
||||||
|
|
||||||
from typing import TYPE_CHECKING, Self, override
|
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.menu.helpers import Selection
|
||||||
from archinstall.lib.output import info
|
from archinstall.lib.output import info
|
||||||
from archinstall.lib.profile.profiles_handler import profile_handler
|
from archinstall.lib.profile.profiles_handler import profile_handler
|
||||||
|
|
@ -95,10 +95,16 @@ class DesktopProfile(Profile):
|
||||||
# Install common packages for all desktop environments
|
# Install common packages for all desktop environments
|
||||||
install_session.add_additional_packages(self.packages)
|
install_session.add_additional_packages(self.packages)
|
||||||
|
|
||||||
|
xorg_installed = False
|
||||||
|
|
||||||
for profile in self.current_selection:
|
for profile in self.current_selection:
|
||||||
info(f'Installing profile {profile.name}...')
|
info(f'Installing profile {profile.name}...')
|
||||||
|
|
||||||
install_session.add_additional_packages(profile.packages)
|
install_session.add_additional_packages(profile.packages)
|
||||||
install_session.enable_service(profile.services)
|
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)
|
profile.install(install_session)
|
||||||
|
|
|
||||||
|
|
@ -2,24 +2,27 @@ from __future__ import annotations
|
||||||
|
|
||||||
from typing import TYPE_CHECKING, override
|
from typing import TYPE_CHECKING, override
|
||||||
|
|
||||||
from archinstall.default_profiles.profile import ProfileType
|
from archinstall.default_profiles.profile import DisplayServerType, Profile, ProfileType
|
||||||
from archinstall.default_profiles.xorg import XorgProfile
|
|
||||||
|
|
||||||
if TYPE_CHECKING:
|
if TYPE_CHECKING:
|
||||||
from archinstall.lib.installer import Installer
|
from archinstall.lib.installer import Installer
|
||||||
|
|
||||||
|
|
||||||
class AwesomeProfile(XorgProfile):
|
class AwesomeProfile(Profile):
|
||||||
def __init__(self) -> None:
|
def __init__(self) -> None:
|
||||||
super().__init__('Awesome', ProfileType.WindowMgr)
|
super().__init__(
|
||||||
|
'Awesome',
|
||||||
|
ProfileType.WindowMgr,
|
||||||
|
support_gfx_driver=True,
|
||||||
|
display_server=DisplayServerType.Xorg,
|
||||||
|
)
|
||||||
|
|
||||||
@property
|
@property
|
||||||
@override
|
@override
|
||||||
def packages(self) -> list[str]:
|
def packages(self) -> list[str]:
|
||||||
return super().packages + [
|
return [
|
||||||
'awesome',
|
'awesome',
|
||||||
'alacritty',
|
'alacritty',
|
||||||
'xorg-xinit',
|
|
||||||
'xorg-xrandr',
|
'xorg-xrandr',
|
||||||
'xterm',
|
'xterm',
|
||||||
'feh',
|
'feh',
|
||||||
|
|
|
||||||
|
|
@ -1,17 +1,20 @@
|
||||||
from typing import override
|
from typing import override
|
||||||
|
|
||||||
from archinstall.default_profiles.profile import GreeterType, ProfileType
|
from archinstall.default_profiles.profile import DisplayServerType, GreeterType, Profile, ProfileType
|
||||||
from archinstall.default_profiles.xorg import XorgProfile
|
|
||||||
|
|
||||||
|
|
||||||
class BspwmProfile(XorgProfile):
|
class BspwmProfile(Profile):
|
||||||
def __init__(self) -> None:
|
def __init__(self) -> None:
|
||||||
super().__init__('Bspwm', ProfileType.WindowMgr)
|
super().__init__(
|
||||||
|
'Bspwm',
|
||||||
|
ProfileType.WindowMgr,
|
||||||
|
support_gfx_driver=True,
|
||||||
|
display_server=DisplayServerType.Xorg,
|
||||||
|
)
|
||||||
|
|
||||||
@property
|
@property
|
||||||
@override
|
@override
|
||||||
def packages(self) -> list[str]:
|
def packages(self) -> list[str]:
|
||||||
# return super().packages + [
|
|
||||||
return [
|
return [
|
||||||
'bspwm',
|
'bspwm',
|
||||||
'sxhkd',
|
'sxhkd',
|
||||||
|
|
|
||||||
|
|
@ -1,12 +1,16 @@
|
||||||
from typing import override
|
from typing import override
|
||||||
|
|
||||||
from archinstall.default_profiles.profile import GreeterType, ProfileType
|
from archinstall.default_profiles.profile import DisplayServerType, GreeterType, Profile, ProfileType
|
||||||
from archinstall.default_profiles.xorg import XorgProfile
|
|
||||||
|
|
||||||
|
|
||||||
class BudgieProfile(XorgProfile):
|
class BudgieProfile(Profile):
|
||||||
def __init__(self) -> None:
|
def __init__(self) -> None:
|
||||||
super().__init__('Budgie', ProfileType.DesktopEnv)
|
super().__init__(
|
||||||
|
'Budgie',
|
||||||
|
ProfileType.DesktopEnv,
|
||||||
|
support_gfx_driver=True,
|
||||||
|
display_server=DisplayServerType.Xorg,
|
||||||
|
)
|
||||||
|
|
||||||
@property
|
@property
|
||||||
@override
|
@override
|
||||||
|
|
|
||||||
|
|
@ -1,12 +1,16 @@
|
||||||
from typing import override
|
from typing import override
|
||||||
|
|
||||||
from archinstall.default_profiles.profile import GreeterType, ProfileType
|
from archinstall.default_profiles.profile import DisplayServerType, GreeterType, Profile, ProfileType
|
||||||
from archinstall.default_profiles.xorg import XorgProfile
|
|
||||||
|
|
||||||
|
|
||||||
class CinnamonProfile(XorgProfile):
|
class CinnamonProfile(Profile):
|
||||||
def __init__(self) -> None:
|
def __init__(self) -> None:
|
||||||
super().__init__('Cinnamon', ProfileType.DesktopEnv)
|
super().__init__(
|
||||||
|
'Cinnamon',
|
||||||
|
ProfileType.DesktopEnv,
|
||||||
|
support_gfx_driver=True,
|
||||||
|
display_server=DisplayServerType.Xorg,
|
||||||
|
)
|
||||||
|
|
||||||
@property
|
@property
|
||||||
@override
|
@override
|
||||||
|
|
|
||||||
|
|
@ -1,12 +1,16 @@
|
||||||
from typing import override
|
from typing import override
|
||||||
|
|
||||||
from archinstall.default_profiles.profile import GreeterType, ProfileType
|
from archinstall.default_profiles.profile import DisplayServerType, GreeterType, Profile, ProfileType
|
||||||
from archinstall.default_profiles.xorg import XorgProfile
|
|
||||||
|
|
||||||
|
|
||||||
class CosmicProfile(XorgProfile):
|
class CosmicProfile(Profile):
|
||||||
def __init__(self) -> None:
|
def __init__(self) -> None:
|
||||||
super().__init__('Cosmic', ProfileType.DesktopEnv)
|
super().__init__(
|
||||||
|
'Cosmic',
|
||||||
|
ProfileType.DesktopEnv,
|
||||||
|
support_gfx_driver=True,
|
||||||
|
display_server=DisplayServerType.Wayland,
|
||||||
|
)
|
||||||
|
|
||||||
@property
|
@property
|
||||||
@override
|
@override
|
||||||
|
|
|
||||||
|
|
@ -1,12 +1,16 @@
|
||||||
from typing import override
|
from typing import override
|
||||||
|
|
||||||
from archinstall.default_profiles.profile import GreeterType, ProfileType
|
from archinstall.default_profiles.profile import DisplayServerType, GreeterType, Profile, ProfileType
|
||||||
from archinstall.default_profiles.xorg import XorgProfile
|
|
||||||
|
|
||||||
|
|
||||||
class CutefishProfile(XorgProfile):
|
class CutefishProfile(Profile):
|
||||||
def __init__(self) -> None:
|
def __init__(self) -> None:
|
||||||
super().__init__('Cutefish', ProfileType.DesktopEnv)
|
super().__init__(
|
||||||
|
'Cutefish',
|
||||||
|
ProfileType.DesktopEnv,
|
||||||
|
support_gfx_driver=True,
|
||||||
|
display_server=DisplayServerType.Xorg,
|
||||||
|
)
|
||||||
|
|
||||||
@property
|
@property
|
||||||
@override
|
@override
|
||||||
|
|
|
||||||
|
|
@ -1,12 +1,16 @@
|
||||||
from typing import override
|
from typing import override
|
||||||
|
|
||||||
from archinstall.default_profiles.profile import GreeterType, ProfileType
|
from archinstall.default_profiles.profile import DisplayServerType, GreeterType, Profile, ProfileType
|
||||||
from archinstall.default_profiles.xorg import XorgProfile
|
|
||||||
|
|
||||||
|
|
||||||
class DeepinProfile(XorgProfile):
|
class DeepinProfile(Profile):
|
||||||
def __init__(self) -> None:
|
def __init__(self) -> None:
|
||||||
super().__init__('Deepin', ProfileType.DesktopEnv)
|
super().__init__(
|
||||||
|
'Deepin',
|
||||||
|
ProfileType.DesktopEnv,
|
||||||
|
support_gfx_driver=True,
|
||||||
|
display_server=DisplayServerType.Xorg,
|
||||||
|
)
|
||||||
|
|
||||||
@property
|
@property
|
||||||
@override
|
@override
|
||||||
|
|
|
||||||
|
|
@ -1,12 +1,16 @@
|
||||||
from typing import override
|
from typing import override
|
||||||
|
|
||||||
from archinstall.default_profiles.profile import GreeterType, ProfileType
|
from archinstall.default_profiles.profile import DisplayServerType, GreeterType, Profile, ProfileType
|
||||||
from archinstall.default_profiles.xorg import XorgProfile
|
|
||||||
|
|
||||||
|
|
||||||
class EnlightenmentProfile(XorgProfile):
|
class EnlightenmentProfile(Profile):
|
||||||
def __init__(self) -> None:
|
def __init__(self) -> None:
|
||||||
super().__init__('Enlightenment', ProfileType.WindowMgr)
|
super().__init__(
|
||||||
|
'Enlightenment',
|
||||||
|
ProfileType.WindowMgr,
|
||||||
|
support_gfx_driver=True,
|
||||||
|
display_server=DisplayServerType.Xorg,
|
||||||
|
)
|
||||||
|
|
||||||
@property
|
@property
|
||||||
@override
|
@override
|
||||||
|
|
|
||||||
|
|
@ -1,12 +1,16 @@
|
||||||
from typing import override
|
from typing import override
|
||||||
|
|
||||||
from archinstall.default_profiles.profile import GreeterType, ProfileType
|
from archinstall.default_profiles.profile import DisplayServerType, GreeterType, Profile, ProfileType
|
||||||
from archinstall.default_profiles.xorg import XorgProfile
|
|
||||||
|
|
||||||
|
|
||||||
class GnomeProfile(XorgProfile):
|
class GnomeProfile(Profile):
|
||||||
def __init__(self) -> None:
|
def __init__(self) -> None:
|
||||||
super().__init__('GNOME', ProfileType.DesktopEnv)
|
super().__init__(
|
||||||
|
'GNOME',
|
||||||
|
ProfileType.DesktopEnv,
|
||||||
|
support_gfx_driver=True,
|
||||||
|
display_server=DisplayServerType.Wayland,
|
||||||
|
)
|
||||||
|
|
||||||
@property
|
@property
|
||||||
@override
|
@override
|
||||||
|
|
|
||||||
|
|
@ -1,17 +1,21 @@
|
||||||
from typing import override
|
from typing import override
|
||||||
|
|
||||||
from archinstall.default_profiles.desktops import SeatAccess
|
from archinstall.default_profiles.desktops import SeatAccess
|
||||||
from archinstall.default_profiles.profile import GreeterType, ProfileType
|
from archinstall.default_profiles.profile import DisplayServerType, GreeterType, Profile, ProfileType
|
||||||
from archinstall.default_profiles.xorg import XorgProfile
|
|
||||||
from archinstall.lib.menu.helpers import Selection
|
from archinstall.lib.menu.helpers import Selection
|
||||||
from archinstall.lib.translationhandler import tr
|
from archinstall.lib.translationhandler import tr
|
||||||
from archinstall.tui.ui.menu_item import MenuItem, MenuItemGroup
|
from archinstall.tui.ui.menu_item import MenuItem, MenuItemGroup
|
||||||
from archinstall.tui.ui.result import ResultType
|
from archinstall.tui.ui.result import ResultType
|
||||||
|
|
||||||
|
|
||||||
class HyprlandProfile(XorgProfile):
|
class HyprlandProfile(Profile):
|
||||||
def __init__(self) -> None:
|
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}
|
self.custom_settings = {'seat_access': None}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,12 +1,16 @@
|
||||||
from typing import override
|
from typing import override
|
||||||
|
|
||||||
from archinstall.default_profiles.profile import GreeterType, ProfileType
|
from archinstall.default_profiles.profile import DisplayServerType, GreeterType, Profile, ProfileType
|
||||||
from archinstall.default_profiles.xorg import XorgProfile
|
|
||||||
|
|
||||||
|
|
||||||
class I3wmProfile(XorgProfile):
|
class I3wmProfile(Profile):
|
||||||
def __init__(self) -> None:
|
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
|
@property
|
||||||
@override
|
@override
|
||||||
|
|
|
||||||
|
|
@ -1,19 +1,20 @@
|
||||||
from typing import override
|
from typing import override
|
||||||
|
|
||||||
from archinstall.default_profiles.desktops import SeatAccess
|
from archinstall.default_profiles.desktops import SeatAccess
|
||||||
from archinstall.default_profiles.profile import GreeterType, ProfileType
|
from archinstall.default_profiles.profile import DisplayServerType, GreeterType, Profile, ProfileType
|
||||||
from archinstall.default_profiles.xorg import XorgProfile
|
|
||||||
from archinstall.lib.menu.helpers import Selection
|
from archinstall.lib.menu.helpers import Selection
|
||||||
from archinstall.lib.translationhandler import tr
|
from archinstall.lib.translationhandler import tr
|
||||||
from archinstall.tui.ui.menu_item import MenuItem, MenuItemGroup
|
from archinstall.tui.ui.menu_item import MenuItem, MenuItemGroup
|
||||||
from archinstall.tui.ui.result import ResultType
|
from archinstall.tui.ui.result import ResultType
|
||||||
|
|
||||||
|
|
||||||
class LabwcProfile(XorgProfile):
|
class LabwcProfile(Profile):
|
||||||
def __init__(self) -> None:
|
def __init__(self) -> None:
|
||||||
super().__init__(
|
super().__init__(
|
||||||
'Labwc',
|
'Labwc',
|
||||||
ProfileType.WindowMgr,
|
ProfileType.WindowMgr,
|
||||||
|
support_gfx_driver=True,
|
||||||
|
display_server=DisplayServerType.Wayland,
|
||||||
)
|
)
|
||||||
|
|
||||||
self.custom_settings = {'seat_access': None}
|
self.custom_settings = {'seat_access': None}
|
||||||
|
|
|
||||||
|
|
@ -1,12 +1,16 @@
|
||||||
from typing import override
|
from typing import override
|
||||||
|
|
||||||
from archinstall.default_profiles.profile import GreeterType, ProfileType
|
from archinstall.default_profiles.profile import DisplayServerType, GreeterType, Profile, ProfileType
|
||||||
from archinstall.default_profiles.xorg import XorgProfile
|
|
||||||
|
|
||||||
|
|
||||||
class LxqtProfile(XorgProfile):
|
class LxqtProfile(Profile):
|
||||||
def __init__(self) -> None:
|
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.
|
# 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.
|
# LXQt works with lightdm, but since this is not supported, we will not default to this.
|
||||||
|
|
|
||||||
|
|
@ -1,12 +1,16 @@
|
||||||
from typing import override
|
from typing import override
|
||||||
|
|
||||||
from archinstall.default_profiles.profile import GreeterType, ProfileType
|
from archinstall.default_profiles.profile import DisplayServerType, GreeterType, Profile, ProfileType
|
||||||
from archinstall.default_profiles.xorg import XorgProfile
|
|
||||||
|
|
||||||
|
|
||||||
class MateProfile(XorgProfile):
|
class MateProfile(Profile):
|
||||||
def __init__(self) -> None:
|
def __init__(self) -> None:
|
||||||
super().__init__('Mate', ProfileType.DesktopEnv)
|
super().__init__(
|
||||||
|
'Mate',
|
||||||
|
ProfileType.DesktopEnv,
|
||||||
|
support_gfx_driver=True,
|
||||||
|
display_server=DisplayServerType.Xorg,
|
||||||
|
)
|
||||||
|
|
||||||
@property
|
@property
|
||||||
@override
|
@override
|
||||||
|
|
|
||||||
|
|
@ -1,19 +1,20 @@
|
||||||
from typing import override
|
from typing import override
|
||||||
|
|
||||||
from archinstall.default_profiles.desktops import SeatAccess
|
from archinstall.default_profiles.desktops import SeatAccess
|
||||||
from archinstall.default_profiles.profile import GreeterType, ProfileType
|
from archinstall.default_profiles.profile import DisplayServerType, GreeterType, Profile, ProfileType
|
||||||
from archinstall.default_profiles.xorg import XorgProfile
|
|
||||||
from archinstall.lib.menu.helpers import Selection
|
from archinstall.lib.menu.helpers import Selection
|
||||||
from archinstall.lib.translationhandler import tr
|
from archinstall.lib.translationhandler import tr
|
||||||
from archinstall.tui.ui.menu_item import MenuItem, MenuItemGroup
|
from archinstall.tui.ui.menu_item import MenuItem, MenuItemGroup
|
||||||
from archinstall.tui.ui.result import ResultType
|
from archinstall.tui.ui.result import ResultType
|
||||||
|
|
||||||
|
|
||||||
class NiriProfile(XorgProfile):
|
class NiriProfile(Profile):
|
||||||
def __init__(self) -> None:
|
def __init__(self) -> None:
|
||||||
super().__init__(
|
super().__init__(
|
||||||
'Niri',
|
'Niri',
|
||||||
ProfileType.WindowMgr,
|
ProfileType.WindowMgr,
|
||||||
|
support_gfx_driver=True,
|
||||||
|
display_server=DisplayServerType.Wayland,
|
||||||
)
|
)
|
||||||
|
|
||||||
self.custom_settings = {'seat_access': None}
|
self.custom_settings = {'seat_access': None}
|
||||||
|
|
|
||||||
|
|
@ -1,12 +1,16 @@
|
||||||
from typing import override
|
from typing import override
|
||||||
|
|
||||||
from archinstall.default_profiles.profile import GreeterType, ProfileType
|
from archinstall.default_profiles.profile import DisplayServerType, GreeterType, Profile, ProfileType
|
||||||
from archinstall.default_profiles.xorg import XorgProfile
|
|
||||||
|
|
||||||
|
|
||||||
class PlasmaProfile(XorgProfile):
|
class PlasmaProfile(Profile):
|
||||||
def __init__(self) -> None:
|
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
|
@property
|
||||||
@override
|
@override
|
||||||
|
|
|
||||||
|
|
@ -1,12 +1,16 @@
|
||||||
from typing import override
|
from typing import override
|
||||||
|
|
||||||
from archinstall.default_profiles.profile import GreeterType, ProfileType
|
from archinstall.default_profiles.profile import DisplayServerType, GreeterType, Profile, ProfileType
|
||||||
from archinstall.default_profiles.xorg import XorgProfile
|
|
||||||
|
|
||||||
|
|
||||||
class QtileProfile(XorgProfile):
|
class QtileProfile(Profile):
|
||||||
def __init__(self) -> None:
|
def __init__(self) -> None:
|
||||||
super().__init__('Qtile', ProfileType.WindowMgr)
|
super().__init__(
|
||||||
|
'Qtile',
|
||||||
|
ProfileType.WindowMgr,
|
||||||
|
support_gfx_driver=True,
|
||||||
|
display_server=DisplayServerType.Xorg,
|
||||||
|
)
|
||||||
|
|
||||||
@property
|
@property
|
||||||
@override
|
@override
|
||||||
|
|
|
||||||
|
|
@ -1,12 +1,16 @@
|
||||||
from typing import override
|
from typing import override
|
||||||
|
|
||||||
from archinstall.default_profiles.profile import GreeterType, ProfileType
|
from archinstall.default_profiles.profile import DisplayServerType, GreeterType, Profile, ProfileType
|
||||||
from archinstall.default_profiles.xorg import XorgProfile
|
|
||||||
|
|
||||||
|
|
||||||
class RiverProfile(XorgProfile):
|
class RiverProfile(Profile):
|
||||||
def __init__(self) -> None:
|
def __init__(self) -> None:
|
||||||
super().__init__('River', ProfileType.WindowMgr)
|
super().__init__(
|
||||||
|
'River',
|
||||||
|
ProfileType.WindowMgr,
|
||||||
|
support_gfx_driver=True,
|
||||||
|
display_server=DisplayServerType.Wayland,
|
||||||
|
)
|
||||||
|
|
||||||
@property
|
@property
|
||||||
@override
|
@override
|
||||||
|
|
|
||||||
|
|
@ -1,19 +1,20 @@
|
||||||
from typing import override
|
from typing import override
|
||||||
|
|
||||||
from archinstall.default_profiles.desktops import SeatAccess
|
from archinstall.default_profiles.desktops import SeatAccess
|
||||||
from archinstall.default_profiles.profile import GreeterType, ProfileType
|
from archinstall.default_profiles.profile import DisplayServerType, GreeterType, Profile, ProfileType
|
||||||
from archinstall.default_profiles.xorg import XorgProfile
|
|
||||||
from archinstall.lib.menu.helpers import Selection
|
from archinstall.lib.menu.helpers import Selection
|
||||||
from archinstall.lib.translationhandler import tr
|
from archinstall.lib.translationhandler import tr
|
||||||
from archinstall.tui.ui.menu_item import MenuItem, MenuItemGroup
|
from archinstall.tui.ui.menu_item import MenuItem, MenuItemGroup
|
||||||
from archinstall.tui.ui.result import ResultType
|
from archinstall.tui.ui.result import ResultType
|
||||||
|
|
||||||
|
|
||||||
class SwayProfile(XorgProfile):
|
class SwayProfile(Profile):
|
||||||
def __init__(self) -> None:
|
def __init__(self) -> None:
|
||||||
super().__init__(
|
super().__init__(
|
||||||
'Sway',
|
'Sway',
|
||||||
ProfileType.WindowMgr,
|
ProfileType.WindowMgr,
|
||||||
|
support_gfx_driver=True,
|
||||||
|
display_server=DisplayServerType.Wayland,
|
||||||
)
|
)
|
||||||
|
|
||||||
self.custom_settings = {'seat_access': None}
|
self.custom_settings = {'seat_access': None}
|
||||||
|
|
|
||||||
|
|
@ -1,12 +1,16 @@
|
||||||
from typing import override
|
from typing import override
|
||||||
|
|
||||||
from archinstall.default_profiles.profile import GreeterType, ProfileType
|
from archinstall.default_profiles.profile import DisplayServerType, GreeterType, Profile, ProfileType
|
||||||
from archinstall.default_profiles.xorg import XorgProfile
|
|
||||||
|
|
||||||
|
|
||||||
class Xfce4Profile(XorgProfile):
|
class Xfce4Profile(Profile):
|
||||||
def __init__(self) -> None:
|
def __init__(self) -> None:
|
||||||
super().__init__('Xfce4', ProfileType.DesktopEnv)
|
super().__init__(
|
||||||
|
'Xfce4',
|
||||||
|
ProfileType.DesktopEnv,
|
||||||
|
support_gfx_driver=True,
|
||||||
|
display_server=DisplayServerType.Xorg,
|
||||||
|
)
|
||||||
|
|
||||||
@property
|
@property
|
||||||
@override
|
@override
|
||||||
|
|
|
||||||
|
|
@ -1,12 +1,16 @@
|
||||||
from typing import override
|
from typing import override
|
||||||
|
|
||||||
from archinstall.default_profiles.profile import GreeterType, ProfileType
|
from archinstall.default_profiles.profile import DisplayServerType, GreeterType, Profile, ProfileType
|
||||||
from archinstall.default_profiles.xorg import XorgProfile
|
|
||||||
|
|
||||||
|
|
||||||
class XmonadProfile(XorgProfile):
|
class XmonadProfile(Profile):
|
||||||
def __init__(self) -> None:
|
def __init__(self) -> None:
|
||||||
super().__init__('Xmonad', ProfileType.WindowMgr)
|
super().__init__(
|
||||||
|
'Xmonad',
|
||||||
|
ProfileType.WindowMgr,
|
||||||
|
support_gfx_driver=True,
|
||||||
|
display_server=DisplayServerType.Xorg,
|
||||||
|
)
|
||||||
|
|
||||||
@property
|
@property
|
||||||
@override
|
@override
|
||||||
|
|
|
||||||
|
|
@ -10,6 +10,11 @@ if TYPE_CHECKING:
|
||||||
from archinstall.lib.models.users import User
|
from archinstall.lib.models.users import User
|
||||||
|
|
||||||
|
|
||||||
|
class DisplayServerType(Enum):
|
||||||
|
Xorg = 'Xorg'
|
||||||
|
Wayland = 'Wayland'
|
||||||
|
|
||||||
|
|
||||||
class ProfileType(Enum):
|
class ProfileType(Enum):
|
||||||
# top level default_profiles
|
# top level default_profiles
|
||||||
Server = 'Server'
|
Server = 'Server'
|
||||||
|
|
@ -52,6 +57,7 @@ class Profile:
|
||||||
services: list[str] = [],
|
services: list[str] = [],
|
||||||
support_gfx_driver: bool = False,
|
support_gfx_driver: bool = False,
|
||||||
support_greeter: bool = False,
|
support_greeter: bool = False,
|
||||||
|
display_server: DisplayServerType | None = None,
|
||||||
) -> None:
|
) -> None:
|
||||||
self.name = name
|
self.name = name
|
||||||
self.profile_type = profile_type
|
self.profile_type = profile_type
|
||||||
|
|
@ -59,6 +65,7 @@ class Profile:
|
||||||
|
|
||||||
self._support_gfx_driver = support_gfx_driver
|
self._support_gfx_driver = support_gfx_driver
|
||||||
self._support_greeter = support_greeter
|
self._support_greeter = support_greeter
|
||||||
|
self._display_server = display_server
|
||||||
|
|
||||||
# self.gfx_driver: str | None = None
|
# self.gfx_driver: str | None = None
|
||||||
|
|
||||||
|
|
@ -169,10 +176,23 @@ class Profile:
|
||||||
def is_greeter_supported(self) -> bool:
|
def is_greeter_supported(self) -> bool:
|
||||||
return self._support_greeter
|
return self._support_greeter
|
||||||
|
|
||||||
|
@property
|
||||||
|
def display_server(self) -> DisplayServerType | None:
|
||||||
|
return self._display_server
|
||||||
|
|
||||||
def preview_text(self) -> str:
|
def preview_text(self) -> str:
|
||||||
"""
|
"""
|
||||||
Override this method to provide a preview text for the profile
|
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()
|
return self.packages_text()
|
||||||
|
|
||||||
def packages_text(self, include_sub_packages: bool = False) -> str:
|
def packages_text(self, include_sub_packages: bool = False) -> str:
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,9 @@
|
||||||
from typing import override
|
from typing import TYPE_CHECKING, override
|
||||||
|
|
||||||
from archinstall.default_profiles.profile import Profile, ProfileType
|
from archinstall.default_profiles.profile import DisplayServerType, Profile, ProfileType
|
||||||
from archinstall.lib.translationhandler import tr
|
|
||||||
|
if TYPE_CHECKING:
|
||||||
|
from archinstall.lib.installer import Installer
|
||||||
|
|
||||||
|
|
||||||
class XorgProfile(Profile):
|
class XorgProfile(Profile):
|
||||||
|
|
@ -14,19 +16,17 @@ class XorgProfile(Profile):
|
||||||
name,
|
name,
|
||||||
profile_type,
|
profile_type,
|
||||||
support_gfx_driver=True,
|
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
|
@property
|
||||||
@override
|
@override
|
||||||
def packages(self) -> list[str]:
|
def packages(self) -> list[str]:
|
||||||
return [
|
return [
|
||||||
'xorg-server',
|
'xorg-server',
|
||||||
|
'xorg-xinit',
|
||||||
]
|
]
|
||||||
|
|
||||||
|
@override
|
||||||
|
def install(self, install_session: Installer) -> None:
|
||||||
|
install_session.add_additional_packages(self.packages)
|
||||||
|
|
|
||||||
|
|
@ -51,8 +51,6 @@ class GfxPackage(Enum):
|
||||||
Xf86VideoAmdgpu = 'xf86-video-amdgpu'
|
Xf86VideoAmdgpu = 'xf86-video-amdgpu'
|
||||||
Xf86VideoAti = 'xf86-video-ati'
|
Xf86VideoAti = 'xf86-video-ati'
|
||||||
Xf86VideoNouveau = 'xf86-video-nouveau'
|
Xf86VideoNouveau = 'xf86-video-nouveau'
|
||||||
XorgServer = 'xorg-server'
|
|
||||||
XorgXinit = 'xorg-xinit'
|
|
||||||
|
|
||||||
|
|
||||||
class GfxDriver(Enum):
|
class GfxDriver(Enum):
|
||||||
|
|
@ -80,7 +78,7 @@ class GfxDriver(Enum):
|
||||||
return text
|
return text
|
||||||
|
|
||||||
def gfx_packages(self) -> list[GfxPackage]:
|
def gfx_packages(self) -> list[GfxPackage]:
|
||||||
packages = [GfxPackage.XorgServer, GfxPackage.XorgXinit]
|
packages: list[GfxPackage] = []
|
||||||
|
|
||||||
match self:
|
match self:
|
||||||
case GfxDriver.AllOpenSource:
|
case GfxDriver.AllOpenSource:
|
||||||
|
|
|
||||||
|
|
@ -349,8 +349,8 @@ class ProfileHandler:
|
||||||
profiles_path = Path(__file__).parents[2] / 'default_profiles'
|
profiles_path = Path(__file__).parents[2] / 'default_profiles'
|
||||||
profiles = []
|
profiles = []
|
||||||
for file in profiles_path.glob('**/*.py'):
|
for file in profiles_path.glob('**/*.py'):
|
||||||
# ignore the abstract default_profiles class
|
# ignore the abstract base classes
|
||||||
if 'profile.py' in file.name:
|
if file.name == 'profile.py':
|
||||||
continue
|
continue
|
||||||
profiles += self._process_profile_file(file)
|
profiles += self._process_profile_file(file)
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue