sorted imports
This commit is contained in:
parent
895e24b368
commit
2eafea9862
12 changed files with 27 additions and 32 deletions
|
@ -1,16 +1,15 @@
|
||||||
#!/bin/env python
|
#!/bin/env python
|
||||||
" Pyprland - an Hyprland companion app "
|
|
||||||
import asyncio
|
import asyncio
|
||||||
from typing import cast
|
|
||||||
import json
|
|
||||||
import sys
|
|
||||||
import os
|
|
||||||
import importlib
|
import importlib
|
||||||
import itertools
|
import itertools
|
||||||
|
import json
|
||||||
|
import os
|
||||||
|
import sys
|
||||||
|
from typing import cast
|
||||||
|
|
||||||
|
from .common import PyprError, get_logger, init_logger
|
||||||
from .ipc import get_event_stream, init as ipc_init
|
from .ipc import get_event_stream
|
||||||
from .common import init_logger, get_logger, PyprError
|
from .ipc import init as ipc_init
|
||||||
from .plugins.interface import Plugin
|
from .plugins.interface import Plugin
|
||||||
|
|
||||||
CONTROL = f'/tmp/hypr/{ os.environ["HYPRLAND_INSTANCE_SIGNATURE"] }/.pyprland.sock'
|
CONTROL = f'/tmp/hypr/{ os.environ["HYPRLAND_INSTANCE_SIGNATURE"] }/.pyprland.sock'
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
""" Shared utilities: logging """
|
""" Shared utilities: logging """
|
||||||
import os
|
|
||||||
import logging
|
import logging
|
||||||
|
import os
|
||||||
|
|
||||||
__all__ = ["DEBUG", "get_logger", "init_logger"]
|
__all__ = ["DEBUG", "get_logger", "init_logger"]
|
||||||
|
|
||||||
|
|
|
@ -1,12 +1,12 @@
|
||||||
#!/bin/env python
|
#!/bin/env python
|
||||||
""" Interact with hyprland using sockets """
|
""" Interact with hyprland using sockets """
|
||||||
import asyncio
|
import asyncio
|
||||||
from logging import Logger
|
|
||||||
from typing import Any
|
|
||||||
import json
|
import json
|
||||||
import os
|
import os
|
||||||
|
from logging import Logger
|
||||||
|
from typing import Any
|
||||||
|
|
||||||
from .common import get_logger, PyprError
|
from .common import PyprError, get_logger
|
||||||
|
|
||||||
log: Logger | None = None
|
log: Logger | None = None
|
||||||
|
|
||||||
|
|
|
@ -2,9 +2,9 @@
|
||||||
toggle_minimized allows having an "expose" like selection of minimized windows
|
toggle_minimized allows having an "expose" like selection of minimized windows
|
||||||
"""
|
"""
|
||||||
from typing import Any, cast
|
from typing import Any, cast
|
||||||
from .interface import Plugin
|
|
||||||
|
|
||||||
from ..ipc import hyprctlJSON, hyprctl
|
from ..ipc import hyprctl, hyprctlJSON
|
||||||
|
from .interface import Plugin
|
||||||
|
|
||||||
|
|
||||||
class Extension(Plugin): # pylint: disable=missing-class-docstring
|
class Extension(Plugin): # pylint: disable=missing-class-docstring
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
" Common plugin interface "
|
" Common plugin interface "
|
||||||
from typing import Any
|
from typing import Any
|
||||||
|
|
||||||
from ..common import get_logger
|
from ..common import get_logger
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
" Moves unreachable client windows to the currently focused workspace"
|
" Moves unreachable client windows to the currently focused workspace"
|
||||||
from typing import Any, cast
|
from typing import Any, cast
|
||||||
from .interface import Plugin
|
|
||||||
|
|
||||||
from ..ipc import hyprctlJSON, hyprctl
|
from ..ipc import hyprctl, hyprctlJSON
|
||||||
|
from .interface import Plugin
|
||||||
|
|
||||||
|
|
||||||
def contains(monitor, window):
|
def contains(monitor, window):
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
" Toggles workspace zooming "
|
" Toggles workspace zooming "
|
||||||
from .interface import Plugin
|
|
||||||
|
|
||||||
from ..ipc import hyprctl
|
from ..ipc import hyprctl
|
||||||
|
from .interface import Plugin
|
||||||
|
|
||||||
|
|
||||||
class Extension(Plugin): # pylint: disable=missing-class-docstring
|
class Extension(Plugin): # pylint: disable=missing-class-docstring
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
" The monitors plugin "
|
" The monitors plugin "
|
||||||
import subprocess
|
import subprocess
|
||||||
from typing import Any, cast
|
from typing import Any, cast
|
||||||
from .interface import Plugin
|
|
||||||
|
|
||||||
from ..ipc import hyprctlJSON
|
from ..ipc import hyprctlJSON
|
||||||
|
from .interface import Plugin
|
||||||
|
|
||||||
|
|
||||||
def configure_monitors(monitors, screenid: str, pos_x: int, pos_y: int) -> None:
|
def configure_monitors(monitors, screenid: str, pos_x: int, pos_y: int) -> None:
|
||||||
|
|
|
@ -1,15 +1,10 @@
|
||||||
" Scratchpads addon "
|
" Scratchpads addon "
|
||||||
import os
|
|
||||||
import asyncio
|
import asyncio
|
||||||
|
import os
|
||||||
import subprocess
|
import subprocess
|
||||||
from typing import Any, cast
|
from typing import Any, cast
|
||||||
|
|
||||||
from ..ipc import (
|
from ..ipc import get_focused_monitor_props, hyprctl, hyprctlJSON
|
||||||
hyprctl,
|
|
||||||
hyprctlJSON,
|
|
||||||
get_focused_monitor_props,
|
|
||||||
)
|
|
||||||
|
|
||||||
from .interface import Plugin
|
from .interface import Plugin
|
||||||
|
|
||||||
DEFAULT_MARGIN = 60
|
DEFAULT_MARGIN = 60
|
||||||
|
@ -230,6 +225,7 @@ class Extension(Plugin): # pylint: disable=missing-class-docstring
|
||||||
if not class_lookup_hack:
|
if not class_lookup_hack:
|
||||||
return False
|
return False
|
||||||
self.log.debug("Lookup hack triggered")
|
self.log.debug("Lookup hack triggered")
|
||||||
|
# hack to update the client info from the provided class
|
||||||
for client in await hyprctlJSON("clients"):
|
for client in await hyprctlJSON("clients"):
|
||||||
assert isinstance(client, dict)
|
assert isinstance(client, dict)
|
||||||
for pending_scratch in class_lookup_hack:
|
for pending_scratch in class_lookup_hack:
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
" shift workspaces across monitors "
|
" shift workspaces across monitors "
|
||||||
from typing import cast
|
from typing import cast
|
||||||
from .interface import Plugin
|
|
||||||
|
|
||||||
from ..ipc import hyprctlJSON, hyprctl
|
from ..ipc import hyprctl, hyprctlJSON
|
||||||
|
from .interface import Plugin
|
||||||
|
|
||||||
|
|
||||||
class Extension(Plugin): # pylint: disable=missing-class-docstring
|
class Extension(Plugin): # pylint: disable=missing-class-docstring
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
" Toggle monitors on or off "
|
" Toggle monitors on or off "
|
||||||
from typing import Any, cast
|
from typing import Any, cast
|
||||||
from .interface import Plugin
|
|
||||||
|
|
||||||
from ..ipc import hyprctlJSON, hyprctl
|
from ..ipc import hyprctl, hyprctlJSON
|
||||||
|
from .interface import Plugin
|
||||||
|
|
||||||
|
|
||||||
class Extension(Plugin): # pylint: disable=missing-class-docstring
|
class Extension(Plugin): # pylint: disable=missing-class-docstring
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
""" Force workspaces to follow the focus / mouse """
|
""" Force workspaces to follow the focus / mouse """
|
||||||
from typing import cast
|
from typing import cast
|
||||||
from .interface import Plugin
|
|
||||||
|
|
||||||
from ..ipc import hyprctlJSON, hyprctl
|
from ..ipc import hyprctl, hyprctlJSON
|
||||||
|
from .interface import Plugin
|
||||||
|
|
||||||
|
|
||||||
class Extension(Plugin): # pylint: disable=missing-class-docstring
|
class Extension(Plugin): # pylint: disable=missing-class-docstring
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue