Add record.sh
This commit is contained in:
16
record.sh
Normal file
16
record.sh
Normal 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"
|
||||
Reference in New Issue
Block a user