Skip to content

Commit

Permalink
Added polkit as an option for the seat. As it's a dependency of the h…
Browse files Browse the repository at this point in the history
…yprland package
  • Loading branch information
Torxed committed Jul 31, 2023
1 parent aaced41 commit 9b293e5
Showing 1 changed file with 13 additions and 25 deletions.
38 changes: 13 additions & 25 deletions archinstall/default_profiles/desktops/hyprland.py
Original file line number Diff line number Diff line change
@@ -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):
Expand Down Expand Up @@ -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()
Expand Down

0 comments on commit 9b293e5

Please sign in to comment.