added some more profiles (#3323)
* gave descriptions to profiles * added some more profiles * removed the descriptions for all of them and fixed the class name * made some fixes * removed the reference to seat * forgot a comma * forgot this seat reference * rewrote river.py * forgot to include river * removed lightdm and added upercase X * added some more fixes * forgot to add labwc as a dep
This commit is contained in:
parent
63b2f986c3
commit
390f4f15f4
|
|
@ -35,7 +35,7 @@ class HyprlandProfile(XorgProfile):
|
|||
"qt6-wayland",
|
||||
"polkit-kde-agent",
|
||||
"grim",
|
||||
"slurp"
|
||||
"slurp",
|
||||
]
|
||||
|
||||
@property
|
||||
|
|
|
|||
|
|
@ -0,0 +1,78 @@
|
|||
from typing import TYPE_CHECKING, override
|
||||
|
||||
from archinstall.default_profiles.desktops import SeatAccess
|
||||
from archinstall.default_profiles.profile import GreeterType, ProfileType, SelectResult
|
||||
from archinstall.default_profiles.xorg import XorgProfile
|
||||
from archinstall.tui.curses_menu import SelectMenu
|
||||
from archinstall.tui.menu_item import MenuItem, MenuItemGroup
|
||||
from archinstall.tui.types import Alignment, FrameProperties, ResultType
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from collections.abc import Callable
|
||||
|
||||
from archinstall.lib.translationhandler import DeferredTranslation
|
||||
|
||||
_: Callable[[str], DeferredTranslation]
|
||||
|
||||
|
||||
class LabwcProfile(XorgProfile):
|
||||
def __init__(self) -> None:
|
||||
super().__init__(
|
||||
'Labwc',
|
||||
ProfileType.WindowMgr,
|
||||
description=''
|
||||
)
|
||||
|
||||
self.custom_settings = {'seat_access': None}
|
||||
|
||||
@property
|
||||
@override
|
||||
def packages(self) -> list[str]:
|
||||
additional = []
|
||||
if seat := self.custom_settings.get('seat_access', None):
|
||||
additional = [seat]
|
||||
|
||||
return [
|
||||
"alacritty",
|
||||
"labwc",
|
||||
] + additional
|
||||
|
||||
@property
|
||||
@override
|
||||
def default_greeter_type(self) -> GreeterType | None:
|
||||
return GreeterType.Lightdm
|
||||
|
||||
@property
|
||||
@override
|
||||
def services(self) -> list[str]:
|
||||
if pref := self.custom_settings.get('seat_access', None):
|
||||
return [pref]
|
||||
return []
|
||||
|
||||
def _ask_seat_access(self) -> None:
|
||||
# need to activate seat service and add to seat group
|
||||
header = str(_('labwc needs access to your seat (collection of hardware devices i.e. keyboard, mouse, etc)'))
|
||||
header += '\n' + str(_('Choose an option to give labwc access to your hardware')) + '\n'
|
||||
|
||||
items = [MenuItem(s.value, value=s) for s in SeatAccess]
|
||||
group = MenuItemGroup(items, sort_items=True)
|
||||
|
||||
default = self.custom_settings.get('seat_access', None)
|
||||
group.set_default_by_value(default)
|
||||
|
||||
result = SelectMenu(
|
||||
group,
|
||||
header=header,
|
||||
allow_skip=False,
|
||||
frame=FrameProperties.min(str(_('Seat access'))),
|
||||
alignment=Alignment.CENTER
|
||||
).run()
|
||||
|
||||
if result.type_ == ResultType.Selection:
|
||||
if result.item() is not None:
|
||||
self.custom_settings['seat_access'] = result.get_value().value
|
||||
|
||||
@override
|
||||
def do_on_select(self) -> SelectResult | None:
|
||||
self._ask_seat_access()
|
||||
return None
|
||||
|
|
@ -0,0 +1,85 @@
|
|||
from typing import TYPE_CHECKING, override
|
||||
|
||||
from archinstall.default_profiles.desktops import SeatAccess
|
||||
from archinstall.default_profiles.profile import GreeterType, ProfileType, SelectResult
|
||||
from archinstall.default_profiles.xorg import XorgProfile
|
||||
from archinstall.tui.curses_menu import SelectMenu
|
||||
from archinstall.tui.menu_item import MenuItem, MenuItemGroup
|
||||
from archinstall.tui.types import Alignment, FrameProperties, ResultType
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from collections.abc import Callable
|
||||
|
||||
from archinstall.lib.translationhandler import DeferredTranslation
|
||||
|
||||
_: Callable[[str], DeferredTranslation]
|
||||
|
||||
|
||||
class NiriProfile(XorgProfile):
|
||||
def __init__(self) -> None:
|
||||
super().__init__(
|
||||
'Niri',
|
||||
ProfileType.WindowMgr,
|
||||
description=''
|
||||
)
|
||||
|
||||
self.custom_settings = {'seat_access': None}
|
||||
|
||||
@property
|
||||
@override
|
||||
def packages(self) -> list[str]:
|
||||
additional = []
|
||||
if seat := self.custom_settings.get('seat_access', None):
|
||||
additional = [seat]
|
||||
|
||||
return [
|
||||
"alacritty",
|
||||
"fuzzel",
|
||||
"mako",
|
||||
"xorg-xwayland",
|
||||
"waybar",
|
||||
"swaybg",
|
||||
"swayidle",
|
||||
"swaylock",
|
||||
"xdg-desktop-portal-gnome"
|
||||
] + additional
|
||||
|
||||
@property
|
||||
@override
|
||||
def default_greeter_type(self) -> GreeterType | None:
|
||||
return GreeterType.Lightdm
|
||||
|
||||
@property
|
||||
@override
|
||||
def services(self) -> list[str]:
|
||||
if pref := self.custom_settings.get('seat_access', None):
|
||||
return [pref]
|
||||
return []
|
||||
|
||||
def _ask_seat_access(self) -> None:
|
||||
# need to activate seat service and add to seat group
|
||||
header = str(_('niri needs access to your seat (collection of hardware devices i.e. keyboard, mouse, etc)'))
|
||||
header += '\n' + str(_('Choose an option to give niri access to your hardware')) + '\n'
|
||||
|
||||
items = [MenuItem(s.value, value=s) for s in SeatAccess]
|
||||
group = MenuItemGroup(items, sort_items=True)
|
||||
|
||||
default = self.custom_settings.get('seat_access', None)
|
||||
group.set_default_by_value(default)
|
||||
|
||||
result = SelectMenu(
|
||||
group,
|
||||
header=header,
|
||||
allow_skip=False,
|
||||
frame=FrameProperties.min(str(_('Seat access'))),
|
||||
alignment=Alignment.CENTER
|
||||
).run()
|
||||
|
||||
if result.type_ == ResultType.Selection:
|
||||
if result.item() is not None:
|
||||
self.custom_settings['seat_access'] = result.get_value().value
|
||||
|
||||
@override
|
||||
def do_on_select(self) -> SelectResult | None:
|
||||
self._ask_seat_access()
|
||||
return None
|
||||
|
|
@ -0,0 +1,23 @@
|
|||
from typing import override
|
||||
|
||||
from archinstall.default_profiles.profile import GreeterType, ProfileType
|
||||
from archinstall.default_profiles.xorg import XorgProfile
|
||||
|
||||
|
||||
class RiverProfile(XorgProfile):
|
||||
def __init__(self) -> None:
|
||||
super().__init__('River', ProfileType.WindowMgr, description='')
|
||||
|
||||
@property
|
||||
@override
|
||||
def packages(self) -> list[str]:
|
||||
return [
|
||||
'foot',
|
||||
'xdg-desktop-portal-wlr',
|
||||
'river'
|
||||
]
|
||||
|
||||
@property
|
||||
@override
|
||||
def default_greeter_type(self) -> GreeterType | None:
|
||||
return GreeterType.Lightdm
|
||||
|
|
@ -0,0 +1,25 @@
|
|||
from typing import override
|
||||
|
||||
from archinstall.default_profiles.profile import GreeterType, ProfileType
|
||||
from archinstall.default_profiles.xorg import XorgProfile
|
||||
|
||||
|
||||
class XmonadProfile(XorgProfile):
|
||||
def __init__(self) -> None:
|
||||
super().__init__('Xmonad', ProfileType.WindowMgr, description='')
|
||||
|
||||
@property
|
||||
@override
|
||||
def packages(self) -> list[str]:
|
||||
return [
|
||||
'xmonad',
|
||||
'xmonad-contrib',
|
||||
'xmonad-extra',
|
||||
'xterm',
|
||||
'dmenu'
|
||||
]
|
||||
|
||||
@property
|
||||
@override
|
||||
def default_greeter_type(self) -> GreeterType | None:
|
||||
return GreeterType.Lightdm
|
||||
Loading…
Reference in New Issue