commit 07acb5e46e833cc5b9198658eb73c6eb70ff9fbb Author: Hojun-Cho Date: Tue May 19 18:39:11 2026 +0900 Add record.sh diff --git a/record.sh b/record.sh new file mode 100644 index 0000000..b07f8ca --- /dev/null +++ b/record.sh @@ -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"