From 8a785ba438215117f96955375e904d38ee14c259 Mon Sep 17 00:00:00 2001 From: "Skylar \"The Cobra\" Widulski" Date: Sun, 14 May 2023 10:49:18 -0400 Subject: [PATCH] Add --yes-{audi,vide}o Signed-off-by: Skylar "The Cobra" Widulski --- README.md | 2 ++ doc/wf-shadow.1.scd | 8 ++++++++ wf-shadow | 10 ++++++++-- 3 files changed, 18 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index fa0f17b..0462f1e 100644 --- a/README.md +++ b/README.md @@ -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. diff --git a/doc/wf-shadow.1.scd b/doc/wf-shadow.1.scd index 86f3440..7827009 100644 --- a/doc/wf-shadow.1.scd +++ b/doc/wf-shadow.1.scd @@ -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* diff --git a/wf-shadow b/wf-shadow index 7b554d5..e40b6fb 100755 --- a/wf-shadow +++ b/wf-shadow @@ -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