From b1f38f62cca4ed0e99facff35c54cf1d537c1347 Mon Sep 17 00:00:00 2001 From: Aaron Hallaert <37899722+aaronhallaert@users.noreply.github.com> Date: Sat, 1 Mar 2025 08:28:15 +0100 Subject: [PATCH] fix: scaled width and height on recording (#809) --- scripts/screen_record.sh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/scripts/screen_record.sh b/scripts/screen_record.sh index 451245f..869bfc5 100755 --- a/scripts/screen_record.sh +++ b/scripts/screen_record.sh @@ -29,9 +29,12 @@ startRecording() { monitor_info=$(hyprctl -j monitors | jq -r ".[] | select(.name == \"$3\")") w=$(echo $monitor_info | jq -r '.width') h=$(echo $monitor_info | jq -r '.height') + scale=$(echo $monitor_info | jq -r '.scale') + scaled_width=$(echo "${w} / ${scale}" | bc) + scaled_height=$(echo "${h} / ${scale}" | bc) x=$(echo $monitor_info | jq -r '.x') y=$(echo $monitor_info | jq -r '.y') - wf-recorder $WF_RECORDER_OPTS --geometry "${x},${y} ${w}x${h}" --file "$outputPath" & + wf-recorder $WF_RECORDER_OPTS --geometry "${x},${y} ${scaled_width}x${scaled_height}" --file "$outputPath" & elif [ "$target" == "region" ]; then wf-recorder $WF_RECORDER_OPTS --geometry "$(slurp)" --file "$outputPath" & else