From c2f2633c620ea815b8849b6f44e6c15cae29e81f Mon Sep 17 00:00:00 2001 From: midn8hustlr <4visekh@gmail.com> Date: Sat, 23 Mar 2024 11:35:55 +0530 Subject: [PATCH] Fix full-screen recording for multimonitors --- .config/ags/scripts/record-script.sh | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/.config/ags/scripts/record-script.sh b/.config/ags/scripts/record-script.sh index a5f221e8b..1dcbf7b79 100755 --- a/.config/ags/scripts/record-script.sh +++ b/.config/ags/scripts/record-script.sh @@ -6,6 +6,9 @@ getdate() { getaudiooutput() { pactl list sources | grep 'Name' | grep 'monitor' | cut -d ' ' -f2 } +getactivemonitor() { + hyprctl monitors -j | gojq -r '.[] | select(.focused == true) | .name' +} cd ~/Videos || exit if pgrep wf-recorder > /dev/null; then @@ -16,10 +19,10 @@ else if [[ "$1" == "--sound" ]]; then wf-recorder --pixel-format yuv420p -f './recording_'"$(getdate)"'.mp4' -t --geometry "$(slurp)" --audio="$(getaudiooutput)" & disown elif [[ "$1" == "--fullscreen-sound" ]]; then - wf-recorder --pixel-format yuv420p -f './recording_'"$(getdate)"'.mp4' -t --audio="$(getaudiooutput)" & disown + wf-recorder -o $(getactivemonitor) --pixel-format yuv420p -f './recording_'"$(getdate)"'.mp4' -t --audio="$(getaudiooutput)" & disown elif [[ "$1" == "--fullscreen" ]]; then - wf-recorder --pixel-format yuv420p -f './recording_'"$(getdate)"'.mp4' -t & disown - else + wf-recorder -o $(getactivemonitor) --pixel-format yuv420p -f './recording_'"$(getdate)"'.mp4' -t & disown + else wf-recorder --pixel-format yuv420p -f './recording_'"$(getdate)"'.mp4' -t --geometry "$(slurp)" & disown fi fi