diff --git a/pyprland/ipc.py b/pyprland/ipc.py index ab8f4fb..c6d725f 100644 --- a/pyprland/ipc.py +++ b/pyprland/ipc.py @@ -51,9 +51,3 @@ async def get_focused_monitor_props(): assert isinstance(monitor, dict) if monitor.get("focused") == True: return monitor - - -async def get_client_props_by_pid(pid: int): - for client in await hyprctlJSON("clients"): - if client.get("pid") == pid: - return client diff --git a/pyprland/plugins/scratchpads.py b/pyprland/plugins/scratchpads.py index 2edb10b..dc8dbf7 100644 --- a/pyprland/plugins/scratchpads.py +++ b/pyprland/plugins/scratchpads.py @@ -4,7 +4,6 @@ from ..ipc import ( hyprctl, hyprctlJSON, get_focused_monitor_props, - get_client_props_by_pid, ) import os @@ -13,6 +12,12 @@ from .interface import Plugin DEFAULT_MARGIN = 60 +async def get_client_props_by_pid(pid: int): + for client in await hyprctlJSON("clients"): + if client.get("pid") == pid: + return client + + class Scratch: def __init__(self, uid, opts): self.uid = uid