Add --yes-{audi,vide}o

Signed-off-by: Skylar "The Cobra" Widulski <cobra@vern.cc>
This commit is contained in:
Skylar "The Cobra" Widulski 2023-05-14 10:49:18 -04:00
parent 133e11d2fe
commit 8a785ba438
Signed by: cobra
GPG Key ID: 4FD8F812083FF6F9
3 changed files with 18 additions and 2 deletions

View File

@ -18,6 +18,8 @@ OPTIONS:
-c, --vcodec CODEC Use CODEC as the video codec in ffmpeg encoding.
-n, --no-audio Disable audio recording. Overrides audio options.
-N, --no-video Disable video recording. Overrides video options.
-y, --yes-audio Enable audio recording. Overrides -n.
-Y, --yes-video Enable video recording. Overrides -N.
-v, --verbose Verbose output.
-h, --help Show this menu.

View File

@ -63,6 +63,14 @@ and wofi(1) in order to accomplish the task.
*-v, --verbose*
Show the output of wf-recorder(1), ffmpeg(1), and wofi(1).
*-Y, --yes-video*
Enable video recording. Overrides _-N_. Saved between clips over the
course of a session's lifetime.
*-y, --yes-audio*
Enable audio recording. Overrides _-n_. Saved between clips over the
course of a session's lifetime.
# ENVIRONMENT
*WF_SHADOW_DIR*

View File

@ -90,6 +90,8 @@ OPTIONS:
-c, --vcodec CODEC Use CODEC as the video codec in ffmpeg encoding.
-n, --no-audio Disable audio recording. Overrides audio options.
-N, --no-video Disable video recording. Overrides video options.
-y, --yes-audio Enable audio recording. Overrides -n.
-Y, --yes-video Enable video recording. Overrides -N.
-v, --verbose Verbose output.
-h, --help Show this menu.
@ -194,6 +196,9 @@ until [ -z "$1" ]; do
'-n' | '--no-audio')
NO_AUDIO=" "
shift 1 ;;
'-y' | '--yes-audio')
NO_AUDIO=""
shift 1 ;;
'-V' | '--video')
VIDEO_DEV="$2"
shift 2 ;;
@ -207,6 +212,9 @@ until [ -z "$1" ]; do
'-N' | '--no-video')
NO_VIDEO=" "
shift 1 ;;
'-Y' | '--yes-video')
NO_VIDEO=""
shift 1 ;;
'-d' | '--debug')
set -x
shift 1 ;;
@ -222,8 +230,6 @@ declare -p NO_AUDIO >> "$RUNTIME"/"$MONITOR".env
declare -p VIDEO_CODEC >> "$RUNTIME"/"$MONITOR".env
declare -p NO_VIDEO >> "$RUNTIME"/"$MONITOR".env
. "$RUNTIME"/"$MONITOR".env
if [ -n "$NO_VIDEO" ] && [ -n "$NO_AUDIO" ]; then
printf "Must have either audio or video recording enabled.\n"
exit 3