Skip to content

Commit

Permalink
rename a function for clarity
Browse files Browse the repository at this point in the history
  • Loading branch information
fdev31 committed Jan 28, 2025
1 parent a9b79ea commit c732564
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions pyprland/ipc.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

__all__ = [
"get_client_props",
"get_focused_monitor_props",
"get_monitor_props",
"hyprctl",
"hyprctl_json",
"notify",
Expand Down Expand Up @@ -170,7 +170,7 @@ async def hyprctl(command: str | list[str], base_command: str = "dispatch", logg
# }}}


async def get_focused_monitor_props(logger: Logger | None = None, name: str | None = None) -> MonitorInfo:
async def get_monitor_props(logger: Logger | None = None, name: str | None = None) -> MonitorInfo:
"""Return focused monitor data if `name` is not defined, else use monitor's name.
Args:
Expand Down
10 changes: 5 additions & 5 deletions pyprland/plugins/scratchpads/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

from ...adapters.units import convert_coords, convert_monitor_dimension
from ...common import MINIMUM_ADDR_LEN, CastBoolMixin, apply_variables, is_rotated, state
from ...ipc import get_client_props, get_focused_monitor_props, notify_error
from ...ipc import get_client_props, get_monitor_props, notify_error
from ...types import ClientInfo, MonitorInfo
from ..interface import Plugin
from .animations import AnimationTarget, Placement
Expand Down Expand Up @@ -70,7 +70,7 @@ def __init__(self, name: str) -> None:
self._hysteresis_tasks = {}
self.get_client_props = staticmethod(partial(get_client_props, logger=self.log))
Scratch.get_client_props = self.get_client_props
self.get_focused_monitor_props = staticmethod(partial(get_focused_monitor_props, logger=self.log))
self.get_monitor_props = staticmethod(partial(get_monitor_props, logger=self.log))

async def exit(self) -> None:
"""Exit hook."""
Expand Down Expand Up @@ -152,7 +152,7 @@ async def _configure_windowrules(self, scratch: Scratch) -> None:
self.log.error("forced monitor %s doesn't exist", forced_monitor)
await self.notify_error(f"Monitor '{forced_monitor}' doesn't exist, check {scratch.uid}'s scratch configuration")
forced_monitor = None
monitor = await self.get_focused_monitor_props(name=forced_monitor)
monitor = await self.get_monitor_props(name=forced_monitor)
width, height = convert_coords(scratch.conf.get("size", "80% 80%"), monitor)

ipc_commands = []
Expand Down Expand Up @@ -510,7 +510,7 @@ async def get_offsets(self, scratch: Scratch, monitor: MonitorInfo | None = None
"""Return offset from config or use margin as a ref."""
offset = scratch.conf.get("offset")
if monitor is None:
monitor = await get_focused_monitor_props(self.log, name=scratch.forced_monitor)
monitor = await get_monitor_props(self.log, name=scratch.forced_monitor)
rotated = is_rotated(monitor)
aspect = reversed(scratch.client_info["size"]) if rotated else scratch.client_info["size"]

Expand Down Expand Up @@ -598,7 +598,7 @@ async def run_show(self, uid: str) -> None:

scratch.visible = True
scratch.meta.space_identifier = get_active_space_identifier()
monitor = await self.get_focused_monitor_props(name=scratch.forced_monitor)
monitor = await self.get_monitor_props(name=scratch.forced_monitor)

assert monitor
assert scratch.full_address, "No address !"
Expand Down
2 changes: 1 addition & 1 deletion pyprland/version.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
"""Package version."""

VERSION = "2.4.3-14"
VERSION = "2.4.3-15"

0 comments on commit c732564

Please sign in to comment.