|
|
@@ -1,11 +1,13 @@
|
|
|
#!/usr/bin/env python3
|
|
|
-from os.path import exists
|
|
|
+
|
|
|
+# pyright: strict, reportAny=false, reportExplicitAny=false, reportUnusedCallResult=false
|
|
|
+
|
|
|
from json import loads
|
|
|
from logging import NOTSET, basicConfig, debug, info
|
|
|
from os import getenv
|
|
|
from subprocess import CalledProcessError, check_output
|
|
|
from sys import argv
|
|
|
-from typing import Any, TypeAlias
|
|
|
+from typing import Any, Literal, TypeAlias, cast, override
|
|
|
|
|
|
HOME = getenv("HOME")
|
|
|
XDG_CONFIG_HOME = getenv("XDG_CONFIG_HOME")
|
|
|
@@ -27,6 +29,7 @@ class Window:
|
|
|
def size(self) -> int:
|
|
|
return self.frame_w * self.frame_h
|
|
|
|
|
|
+ @override
|
|
|
def __repr__(self) -> str:
|
|
|
return (
|
|
|
f"Window({self.title} | {self.app}"
|
|
|
@@ -47,6 +50,7 @@ class Space:
|
|
|
self.has_focus: bool = data["has-focus"]
|
|
|
self.is_native_fullscreen: bool = data["is-native-fullscreen"]
|
|
|
|
|
|
+ @override
|
|
|
def __repr__(self) -> str:
|
|
|
return (
|
|
|
f"Space({self.label if self.label and len(self.label) > 0 else '<NoLabel>'}"
|
|
|
@@ -69,6 +73,7 @@ class YabaiDisplay:
|
|
|
self.spaces: list[str] = data["spaces"]
|
|
|
self.frame: dict[str, int] = data["frame"]
|
|
|
|
|
|
+ @override
|
|
|
def __repr__(self) -> str:
|
|
|
return (
|
|
|
f"Display({self.label if self.label and len(self.label) > 0 else '<NoLabel>'}"
|