58 lines
1.2 KiB
Python
58 lines
1.2 KiB
Python
from typing import TypedDict, NotRequired, Tuple
|
|
|
|
|
|
class MemoryProfile(TypedDict):
|
|
"""Defines a memory profile for an application implemented through SystemD resource control"""
|
|
|
|
high: str
|
|
max: str
|
|
|
|
|
|
class Workspace(TypedDict):
|
|
"""Defines a workspace"""
|
|
|
|
index: int
|
|
name: str
|
|
exec: str
|
|
program_name: str
|
|
args: NotRequired[list[str]]
|
|
environ: NotRequired[dict[str, str]]
|
|
systemd: NotRequired[bool]
|
|
void_ouptut: NotRequired[bool]
|
|
memory_profile: NotRequired[MemoryProfile]
|
|
|
|
|
|
class Output(TypedDict):
|
|
"""Defines an output to match for contexts"""
|
|
|
|
make: NotRequired[str]
|
|
model: NotRequired[str]
|
|
serial: NotRequired[str]
|
|
names: NotRequired[list[str]]
|
|
group: NotRequired[str]
|
|
position: Tuple[int, int]
|
|
mode: str
|
|
bars: list[str]
|
|
|
|
|
|
class Group(TypedDict):
|
|
"""Defines a group of workspaces, that exists on a single output"""
|
|
|
|
workspaces: list[int]
|
|
reverse: NotRequired[bool]
|
|
|
|
|
|
class Context(TypedDict):
|
|
"""Defines a context for a workspace"""
|
|
|
|
outputs: list[Output]
|
|
primary: str
|
|
groups: dict[str, Group]
|
|
priority: NotRequired[int]
|
|
|
|
|
|
class Config(TypedDict):
|
|
workspaces: list[Workspace]
|
|
contexts: dict[str, Context]
|
|
default_context: str
|