first commit

This commit is contained in:
2026-05-26 19:25:02 +09:00
commit 972392a192
5 changed files with 131 additions and 0 deletions

26
scr Executable file
View File

@@ -0,0 +1,26 @@
#!/bin/bash
if ! command -v slop >/dev/null; then
echo "scr: slop not found" >&2
exit 1
fi
copy=0
if [ $# -eq 0 ]; then
copy=1
out=$(mktemp --suffix=.png)
else
out=$1
fi
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"
if [ $copy -eq 1 ]; then
xclip -selection clipboard -t image/png -i "$out"
fi
echo "$out"