diff --git a/home/dot_local/bin/executable_screc b/home/dot_local/bin/executable_screc index 4c5aa70..6e3abc6 100644 --- a/home/dot_local/bin/executable_screc +++ b/home/dot_local/bin/executable_screc @@ -6,18 +6,29 @@ tmpd=$(mktemp -d -t screc.XXXXXX) outfile="${tmpd}/out.webm" +intermediate="${tmpd}/int.mkv" geometry=$(slurp) -wf-recorder -g "$geometry" -c libvpx -f "$outfile" &>1 /dev/null & +wf-recorder -g "$geometry" -f "$intermediate" & + + recpid=$! read -sn1 -p 'Press any key to stop recording:' echo kill $recpid + +ffmpeg -i $intermediate -r 10 -c:v libvpx-vp9 -row-mt 1 -b:v 0 -pass 1 -an -f null /dev/null +ffmpeg -i $intermediate -r 10 -c:v libvpx-vp9 -row-mt 1 -b:v 0 -pass 2 -crf 30 $outfile + echo "$outfile" wl-copy -t text/uri-list "file://$outfile" +notify-send --expire-time 10000 \ + --app-name=Screc \ + "Recording Ready" \ + "Screen recording saved to $outfile and copied to clipboard" (sleep 60 && rm -r $tmpd) & disown