From 9b293e517135a9c99ad8a27e87a975634a25beb1 Mon Sep 17 00:00:00 2001 From: Anton Hvornum Date: Mon, 31 Jul 2023 10:21:56 +0200 Subject: [PATCH] Added polkit as an option for the seat. As it's a dependency of the hyprland package --- .../default_profiles/desktops/hyprland.py | 38 +++++++------------ 1 file changed, 13 insertions(+), 25 deletions(-) diff --git a/archinstall/default_profiles/desktops/hyprland.py b/archinstall/default_profiles/desktops/hyprland.py index f26abd0ed3..5383d3340f 100644 --- a/archinstall/default_profiles/desktops/hyprland.py +++ b/archinstall/default_profiles/desktops/hyprland.py @@ -1,15 +1,18 @@ from enum import Enum -from typing import List, Optional, Any, TYPE_CHECKING +from typing import List, Optional, TYPE_CHECKING, Any from archinstall.default_profiles.profile import ProfileType, GreeterType from archinstall.default_profiles.xorg import XorgProfile +from archinstall.lib.menu import Menu if TYPE_CHECKING: + from archinstall.lib.installer import Installer _: Any class SeatAccess(Enum): seatd = 'seatd' + polkit = 'polkit' class HyperlandProfile(XorgProfile): @@ -40,33 +43,18 @@ def services(self) -> List[str]: return [] def _ask_seat_access(self): - """need to activate seat service and add to seat group""" + # need to activate seat service and add to seat group + title = str(_('Hyprland needs access to your seat (collection of hardware devices i.e. keyboard, mouse, etc)')) + title += str(_('\n\nChoose an option to give Hyprland access to your hardware')) - # title = str(_('Hyprland needs access to your seat (collection of hardware devices i.e. keyboard, mouse, etc)')) - # title += str(_('\n\nChoose an option to give Hyprland access to your hardware')) + options = [e.value for e in SeatAccess] + default = None - # options = [e.value for e in SeatAccess] - # default = None + if seat := self.custom_settings.get('seat_access', None): + default = seat - # if seat := self.custom_settings.get('seat_access', None): - # default = seat - - # choice = Menu(title, options, skip=False, preset_values=default).run() - # self.custom_settings['seat_access'] = choice.single_value - # self.custom_settings['seat_access'] = SeatAccess.seatd# need to activate seat service and add to seat group - # title = str(_('Hyprland needs access to your seat (collection of hardware devices i.e. keyboard, mouse, etc)')) - # title += str(_('\n\nChoose an option to give Hyprland access to your hardware')) - - # options = [e.value for e in SeatAccess] - # default = None - - # if seat := self.custom_settings.get('seat_access', None): - # default = seat - - # choice = Menu(title, options, skip=False, preset_values=default).run() - # self.custom_settings['seat_access'] = choice.single_value - - self.custom_settings['seat_access'] = SeatAccess.seatd + choice = Menu(title, options, skip=False, preset_values=default).run() + self.custom_settings['seat_access'] = choice.single_value def do_on_select(self): self._ask_seat_access()