From eb74a97a0cdfe80ccc9aee32ae78853645947ddf Mon Sep 17 00:00:00 2001 From: Ryan Hughes Date: Fri, 10 Oct 2025 21:23:42 -0400 Subject: [PATCH] Fix scaling for non 16:9 --- bin/omarchy-cmd-screenrecord | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/bin/omarchy-cmd-screenrecord b/bin/omarchy-cmd-screenrecord index 3693e76f..f3b377d0 100755 --- a/bin/omarchy-cmd-screenrecord +++ b/bin/omarchy-cmd-screenrecord @@ -27,12 +27,15 @@ cleanup_webcam() { start_webcam_overlay() { cleanup_webcam + # Get monitor scale local scale=$(hyprctl monitors -j | jq -r '.[] | select(.focused == true) | .scale') - local width=$(awk "BEGIN {printf \"%.0f\", 360 * $scale}") - local height=$(awk "BEGIN {printf \"%.0f\", 203 * $scale}") + # Target width (base 360px, scaled to monitor) + local target_width=$(awk "BEGIN {printf \"%.0f\", 360 * $scale}") + + # Scale maintaining aspect ratio (-1 means auto-calculate to maintain ratio) ffplay -f v4l2 -framerate 30 /dev/video0 \ - -vf "scale=${width}:${height}" \ + -vf "scale=${target_width}:-1" \ -window_title "WebcamOverlay" \ -noborder \ -fflags nobuffer -flags low_delay \