Skip to content

Instantly share code, notes, and snippets.

@tommyp6
Last active January 2, 2021 14:37
Show Gist options
  • Select an option

  • Save tommyp6/eb619e0a130b82e8fe28de4d386108c9 to your computer and use it in GitHub Desktop.

Select an option

Save tommyp6/eb619e0a130b82e8fe28de4d386108c9 to your computer and use it in GitHub Desktop.
#!/bin/bash
read -p "Do you want to enable the webcam while recording?" yn
case $yn in
[Yy]* )
pkill -f /dev/video || mpv --no-osc --no-input-default-bindings --input-conf=/dev/null --geometry=-0-0 --autofit=30% --title="mpvfloat" --profile=low-latency --untimed /dev/video0
;;
esac
fname="$(date +'%d-%m-%Y')_$(openssl rand -hex 2)"
ffmpeg -video_size 1920x1080 -framerate 60 -f x11grab -r 30 -i :0.0 "screenrecord_$fname.mp4"
echo "Finished recording..."
echo "Output file: screenrecord_$fname.mp4"
while true; do
read -p "Do you wish to copy the output video to a VM?" yn
case $yn in
[Yy]* )
read -p "Enter destination VM: " vm_name
qvm-copy-to-vm "$vm_name" "screenrecord_$fname.mp4"
exit
;;
[Nn]* ) exit ;;
* ) echo "Please enter [Y]es or [N]o" ;;
esac
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment