dotfiles

My collection of dotfiles
git clone git://git.noxz.tech/dotfiles
Log | Files | Refs

commit 3d6a8cfeb5bb69a3503bc8d2296e6b47a1d8d88b
parent 257a00474dc160d991753cfc4de9005f7b765b5f
Author: Chris Noxz <chris@noxz.tech>
Date:   Fri,  1 Nov 2019 20:34:10 +0100

[bin] Add screenrec based on xrectdraw

Diffstat:
Abin/.bin/screenrec | 21+++++++++++++++++++++
1 file changed, 21 insertions(+), 0 deletions(-)

diff --git a/bin/.bin/screenrec b/bin/.bin/screenrec @@ -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 "$HOME/screenrec-$(date +%Y-%m-%dT%H:%M:%S).mkv" & + +# store ffmpeg pid +ffmpeg_pid=$! + +# run xrectdraw to indicate region being recorded +xrectdraw $geo \#ff0000 2:2:5:2 + +# when xrectdraw dies kill ffmpeg +kill $ffmpeg_pid