xrectdraw

Draw geometry of a rectangular screen region
git clone git://git.noxz.tech/xrectdraw
Log | Files | Refs | README | LICENSE

commit 38eedb32ffe945c37dedb554afbb0fda70111c2f
parent 2f6ee0a803e6de6c71fd51d8cfe00ecb3cafd815
Author: Chris Noxz <chris@noxz.tech>
Date:   Fri,  1 Nov 2019 14:50:08 +0100

Add screenrec.sh as example usage of xrectdraw

Diffstat:
Ascreenrec.sh | 21+++++++++++++++++++++
1 file changed, 21 insertions(+), 0 deletions(-)

diff --git a/screenrec.sh b/screenrec.sh @@ -0,0 +1,21 @@ +#!/bin/sh + +# use xrectsel to define region +geo=$(xrectsel "%x %y %w %h") + +# record region on screen using backgrounded ffmpeg +ffmpeg \ + -video_size $(echo $geo | awk {'print $3 "x" $4'}) \ + -framerate 25 \ + -f x11grab \ + -i $(echo $geo | awk {'print ":0.0+" $1 "," $2'}) \ + -y output.mkv & + +# store ffmpeg pid +ffmpeg_pid=$! + +# run xrectdraw to indicate region being recorded +xrectdraw $geo \#ff0000 + +# when xrectdraw dies kill ffmpeg +kill $ffmpeg_pid