aboutsummaryrefslogtreecommitdiffstats
path: root/x11/py-waypaper/files/patch-waypaper_changer.py
diff options
context:
space:
mode:
authorNicola Vitale <nivit@FreeBSD.org>2025-09-25 17:23:35 +0200
committerNicola Vitale <nivit@FreeBSD.org>2025-09-25 17:35:38 +0200
commite4af422f432a1d3ad8babbce27378b7bfa98fd96 (patch)
tree3d1234201af19adbf82ee4c5debaf79de2913acf /x11/py-waypaper/files/patch-waypaper_changer.py
parent92b470b0a9c205b655fff295c54964f65a2d8822 (diff)
x11/py-waypaper: Add a patch for operating with swww v. 0.11.X
- Add a patch to fix the option --fill-color sent to swww, which was changed in version 0.11.0 (of that program). See https://github.com/anufrievroman/waypaper/issues/183 and https://github.com/LGFae/swww/releases/tag/v0.11.0 - Pet portlint (lines too long in pkg-descr) - Bump PORTREVISION
Diffstat (limited to 'x11/py-waypaper/files/patch-waypaper_changer.py')
-rw-r--r--x11/py-waypaper/files/patch-waypaper_changer.py19
1 files changed, 19 insertions, 0 deletions
diff --git a/x11/py-waypaper/files/patch-waypaper_changer.py b/x11/py-waypaper/files/patch-waypaper_changer.py
new file mode 100644
index 000000000000..c6994c8df161
--- /dev/null
+++ b/x11/py-waypaper/files/patch-waypaper_changer.py
@@ -0,0 +1,19 @@
+--- waypaper/changer.py.orig 2025-02-28 01:09:43 UTC
++++ waypaper/changer.py
+@@ -138,9 +138,15 @@ def change_with_swww(image_path: Path, cf: Config, mon
+ subprocess.Popen(["swww-daemon"])
+ print("Launched swww-daemon")
+
++ version_p = subprocess.run(["swww", "-V"], capture_output=True, text=True)
++ swww_version = [int(x) for x in version_p.stdout.strip().split(" ")[1].split(".")]
++
+ command = ["swww", "img", image_path]
+ command.extend(["--resize", fill])
+- command.extend(["--fill-color", cf.color])
++ if swww_version >= [0, 11, 0]:
++ command.extend(["--fill-color", cf.color.lstrip("#")])
++ else:
++ command.extend(["--fill-color", cf.color])
+ command.extend(["--transition-type", cf.swww_transition_type])
+ command.extend(["--transition-step", str(cf.swww_transition_step)])
+ command.extend(["--transition-angle", str(cf.swww_transition_angle)])