#!/usr/bin/env bash
# Capture the current display to a PNG.
#
#   screenshot out.png
#
# Used to diff Godot's rendering against `sylpheed-cli screen render`. Captures
# the whole 1280x720 root window, which is exactly the design space the screens
# are authored in, so a capture and a composite are directly comparable without
# cropping or scaling.
set -euo pipefail
out="${1:?usage: screenshot OUT.png}"
import -display "${DISPLAY:-:97}" -window root "$out"
identify -format 'captured %wx%h -> %f\n' "$out"
