Massive refactor (Zed wouldn't stop complaining about formatting) and
beginning of proper GNOME implementation.
This commit is contained in:
@@ -1,10 +1,10 @@
|
||||
from .abstracts import AbstractDisplay
|
||||
|
||||
from . import gnome, plasma, wlroots
|
||||
|
||||
from enum import Enum, StrEnum
|
||||
from typing import Optional, Type
|
||||
|
||||
from . import gnome, plasma, wlroots
|
||||
from .abstracts import AbstractDisplay
|
||||
|
||||
|
||||
class MetaMixin(str):
|
||||
def __new__(cls, text: str, meta: AbstractDisplay):
|
||||
obj = str.__new__(cls, text)
|
||||
@@ -12,6 +12,7 @@ class MetaMixin(str):
|
||||
obj.meta = meta
|
||||
return obj
|
||||
|
||||
|
||||
class DisplayManagerDriver(MetaMixin, Enum):
|
||||
GNOME = ("GNOME (Mutter)", gnome.Display)
|
||||
PLASMA = ("KDE Plasma 5/6 (KWin)", plasma.Display)
|
||||
@@ -22,7 +23,10 @@ class DisplayManagerDriver(MetaMixin, Enum):
|
||||
def get_display_list(cls):
|
||||
return [display for display in cls if display.meta is not None]
|
||||
|
||||
|
||||
class Error(StrEnum):
|
||||
DISPLAY_TYPE_NOT_IMPL = "Requested manager type has not been implemented!"
|
||||
DISPLAY_TYPE_UNKNOWN = "Requested manager type does not exist."
|
||||
DISPLAY_INFER_TYPE_FAILURE = "Could not infer a compatible display manager from supported list."
|
||||
DISPLAY_INFER_TYPE_FAILURE = (
|
||||
"Could not infer a compatible display manager from supported list."
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user