From d4b0ba5d944dc3aa05db05f92ee9af305c4a02f4 Mon Sep 17 00:00:00 2001 From: observable Date: Wed, 24 Sep 2025 13:37:56 -0500 Subject: [PATCH] Use output display or region geometry to record The previous code did not identify the output display correctly, leading to wf-recorder asking the user to select the region when the user requested the display output to be selected. With this change the bash script will use slurp with the -o flag to identify the display output. This has not been tested with wl-screenrec as no change has been made to its call signature in omarchy-cmd-screenrecord and the wl-screenrec binary is not included in the default omarchy installation. --- bin/omarchy-cmd-screenrecord | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/bin/omarchy-cmd-screenrecord b/bin/omarchy-cmd-screenrecord index 29fda33d..ee4622f2 100755 --- a/bin/omarchy-cmd-screenrecord +++ b/bin/omarchy-cmd-screenrecord @@ -15,7 +15,7 @@ SCOPE="$1" AUDIO=$([[ $2 == "audio" ]] && echo "--audio") start_screenrecording() { - filename="$OUTPUT_DIR/screenrecording-$(date +'%Y-%m-%d_%H-%M-%S').mp4" + local filename="$OUTPUT_DIR/screenrecording-$(date +'%Y-%m-%d_%H-%M-%S').mp4" if lspci | grep -qi 'nvidia'; then wf-recorder $AUDIO -f "$filename" -c libx264 -p crf=23 -p preset=medium -p movflags=+faststart "$@" & @@ -47,7 +47,8 @@ screenrecording_active() { if screenrecording_active; then stop_screenrecording elif [[ "$SCOPE" == "output" ]]; then - start_screenrecording + output=$(slurp -o) || exit 1 + start_screenrecording -g "$output" else region=$(slurp) || exit 1 start_screenrecording -g "$region"