Add video selection to dmenurecord (#825)
This commit is contained in:
parent
11d4f16fb4
commit
3215e7b4bb
1 changed files with 19 additions and 1 deletions
|
@ -80,11 +80,12 @@ audio() { \
|
||||||
}
|
}
|
||||||
|
|
||||||
askrecording() { \
|
askrecording() { \
|
||||||
choice=$(printf "screencast\\nvideo\\naudio\\nwebcam\\nwebcam (hi-def)" | dmenu -i -p "Select recording style:")
|
choice=$(printf "screencast\\nvideo\\nvideo selected\\naudio\\nwebcam\\nwebcam (hi-def)" | dmenu -i -p "Select recording style:")
|
||||||
case "$choice" in
|
case "$choice" in
|
||||||
screencast) screencast;;
|
screencast) screencast;;
|
||||||
audio) audio;;
|
audio) audio;;
|
||||||
video) video;;
|
video) video;;
|
||||||
|
*selected) videoselected;;
|
||||||
webcam) webcam;;
|
webcam) webcam;;
|
||||||
"webcam (hi-def)") webcamhidef;;
|
"webcam (hi-def)") webcamhidef;;
|
||||||
esac
|
esac
|
||||||
|
@ -95,11 +96,28 @@ asktoend() { \
|
||||||
[ "$response" = "Yes" ] && killrecording
|
[ "$response" = "Yes" ] && killrecording
|
||||||
}
|
}
|
||||||
|
|
||||||
|
videoselected()
|
||||||
|
{
|
||||||
|
slop -f "%x %y %w %h" > /tmp/slop
|
||||||
|
read -r X Y W H < /tmp/slop
|
||||||
|
rm /tmp/slop
|
||||||
|
|
||||||
|
ffmpeg \
|
||||||
|
-f x11grab \
|
||||||
|
-framerate 60 \
|
||||||
|
-video_size "$W"x"$H" \
|
||||||
|
-i :0.0+"$X,$Y" \
|
||||||
|
-c:v libx264 -qp 0 -r 30 \
|
||||||
|
"$HOME/box-$(date '+%y%m%d-%H%M-%S').mkv" &
|
||||||
|
echo $! > /tmp/recordingpid
|
||||||
|
updateicon "⏺️"
|
||||||
|
}
|
||||||
|
|
||||||
case "$1" in
|
case "$1" in
|
||||||
screencast) screencast;;
|
screencast) screencast;;
|
||||||
audio) audio;;
|
audio) audio;;
|
||||||
video) video;;
|
video) video;;
|
||||||
|
*selected) videoselected;;
|
||||||
kill) killrecording;;
|
kill) killrecording;;
|
||||||
*) ([ -f /tmp/recordingpid ] && asktoend && exit) || askrecording;;
|
*) ([ -f /tmp/recordingpid ] && asktoend && exit) || askrecording;;
|
||||||
esac
|
esac
|
||||||
|
|
Loading…
Reference in a new issue