From 121c11c26bf6e5dba97711049c3e32fcff42ab21 Mon Sep 17 00:00:00 2001 From: iliayar Date: Sun, 24 Sep 2023 14:44:10 +0300 Subject: [PATCH] feat scratchpads: Support monitor scale --- pyprland/plugins/scratchpads.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pyprland/plugins/scratchpads.py b/pyprland/plugins/scratchpads.py index c203b4b..ddcb6f1 100644 --- a/pyprland/plugins/scratchpads.py +++ b/pyprland/plugins/scratchpads.py @@ -423,7 +423,8 @@ class Extension(Plugin): # pylint: disable=missing-class-docstring p = int(s[:-1]) if p < 0 or p > 100: raise Exception(f"Percentage must be in range [0; 100], got {p}") - return int(monitor[dim] * p / 100) + scale = float(monitor["scale"]) + return int(monitor[dim] / scale * p / 100) else: raise Exception(f"Unsupported format for dimension {dim} size, got {s}")