Add x11grab helper script
Signed-off-by: Knut Ahlers <knut@ahlers.me>
This commit is contained in:
parent
8f67ba30c6
commit
43ae2fb105
1 changed files with 17 additions and 0 deletions
17
bin/x11grab
Executable file
17
bin/x11grab
Executable file
|
@ -0,0 +1,17 @@
|
|||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
|
||||
source ~/bin/script_framework.sh
|
||||
|
||||
step "Please select area of screen..."
|
||||
slopout=$(slop -f '%x %y %w %h %g %i')
|
||||
X=$(echo "${slopout}" | cut -d ' ' -f 1)
|
||||
Y=$(echo "${slopout}" | cut -d ' ' -f 2)
|
||||
W=$(echo "${slopout}" | cut -d ' ' -f 3)
|
||||
H=$(echo "${slopout}" | cut -d ' ' -f 4)
|
||||
G=$(echo "${slopout}" | cut -d ' ' -f 5)
|
||||
|
||||
outfile="/tmp/$(date +%Y-%m-%d_%H-%M-%S).mp4"
|
||||
|
||||
step "Initiating capture of ${G} to ${outfile}, Ctrl+C to stop..."
|
||||
exec ffmpeg -video_size ${W}x${H} -framerate 30 -f x11grab -i :0.0+${X},${Y} "${outfile}"
|
Loading…
Reference in a new issue