mirror of
https://github.com/LukeHagar/omarchy.git
synced 2025-12-06 04:20:23 +00:00
Fix scaling for non 16:9
This commit is contained in:
@@ -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 \
|
||||
|
||||
Reference in New Issue
Block a user