Add record.sh

This commit is contained in:
2026-05-19 18:39:11 +09:00
commit 07acb5e46e

16
record.sh Normal file
View File

@@ -0,0 +1,16 @@
#!/bin/bash
if ! command -v slop >/dev/null; then
echo "capture: slop not found" >&2
exit 1
fi
out=${1:-$(date +%Y%m%d-%H%M%S).png}
coords=$(slop -f "%x %y %w %h" 2>/dev/null) || exit 1
read x y w h <<<"$coords"
ffmpeg -f x11grab -loglevel error -s ${w}x${h} \
-i ${DISPLAY}+${x},${y} -frames:v 1 -y "$out"
echo "$out"