dotfiles/home/dot_local/bin/executable_screc

24 lines
504 B
Bash

#!/bin/sh
# Take a screen recording in webm format using wf-recorder
# The output file is echo'd to stdout and the path copied
# using the text/uri-list mimetype to the clipboard.
tmpd=$(mktemp -d -t screc.XXXXXX)
outfile="${tmpd}/out.webm"
geometry=$(slurp)
wf-recorder -g "$geometry" -c libvpx -f "$outfile" &>1 /dev/null &
recpid=$!
read -sn1 -p 'Press any key to stop recording:'
echo
kill $recpid
echo "$outfile"
wl-copy -t text/uri-list "file://$outfile"
(sleep 60 && rm -r $tmpd) &
disown