fix: scaled width and height on recording (#809)

This commit is contained in:
Aaron Hallaert
2025-03-01 08:28:15 +01:00
committed by GitHub
parent 4810d0f502
commit b1f38f62cc

View File

@@ -29,9 +29,12 @@ startRecording() {
monitor_info=$(hyprctl -j monitors | jq -r ".[] | select(.name == \"$3\")") monitor_info=$(hyprctl -j monitors | jq -r ".[] | select(.name == \"$3\")")
w=$(echo $monitor_info | jq -r '.width') w=$(echo $monitor_info | jq -r '.width')
h=$(echo $monitor_info | jq -r '.height') 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') x=$(echo $monitor_info | jq -r '.x')
y=$(echo $monitor_info | jq -r '.y') 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 elif [ "$target" == "region" ]; then
wf-recorder $WF_RECORDER_OPTS --geometry "$(slurp)" --file "$outputPath" & wf-recorder $WF_RECORDER_OPTS --geometry "$(slurp)" --file "$outputPath" &
else else