From 0c4165464540c49cd0450bd1f77f37b7caf562cd Mon Sep 17 00:00:00 2001 From: aclist <92275929+aclist@users.noreply.github.com> Date: Fri, 6 Nov 2026 19:18:35 +0900 Subject: [PATCH] feat: add screenshot dumper --- scripts/scrot.py | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 scripts/scrot.py diff --git a/scripts/scrot.py b/scripts/scrot.py new file mode 100644 index 0000000..9dbf04e --- /dev/null +++ b/scripts/scrot.py @@ -0,0 +1,23 @@ +import subprocess +from pathlib import Path + +from dzgui.app_init import build_gui + + +def get_git_root() -> Path: + proc = subprocess.run( + ["git", "rev-parse", "--show-toplevel"], capture_output=True, text=True + ) + if proc.returncode != 0: + raise OSError("Failed to parse git root") + return Path(proc.stdout.rstrip()) + + +def get_image_path() -> Path: + return get_git_root().joinpath("dzgui/data/images/example.png") + + +p = get_image_path() +app = build_gui("", False) +app.set_automation_param("screenshot_path", p) +app.run(None)