From dc3923f5130ef252605869e70fc7b143bf82add6 Mon Sep 17 00:00:00 2001 From: Hannes Weissteiner Date: Tue, 1 Jul 2025 13:28:31 +0200 Subject: [PATCH] Handle transformed monitors for full monitor screenshots --- hyprshot | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hyprshot b/hyprshot index 0fb976f..5deff3d 100755 --- a/hyprshot +++ b/hyprshot @@ -186,13 +186,13 @@ function grab_active_output() { Print "Active workspace: %s\n" "$active_workspace" local current_monitor="$(echo $monitors | jq -r 'first(.[] | select(.activeWorkspace.id == '$(echo $active_workspace | jq -r '.id')'))')" Print "Current output: %s\n" "$current_monitor" - echo $current_monitor | jq -r '"\(.x),\(.y) \(.width/.scale|round)x\(.height/.scale|round)"' + echo $current_monitor | jq -r 'if (.transform % 2 == 0) then "\(.x),\(.y) \((.width / .scale | round))x\((.height / .scale | round))" else "\(.x),\(.y) \((.height / .scale | round))x\((.width / .scale | round))" end' } function grab_selected_output() { local monitor=`hyprctl -j monitors | jq -r '.[] | select(.name == "'$(echo $1)'")'` Print "Capturing: %s\n" "${1}" - echo $monitor | jq -r '"\(.x),\(.y) \(.width/.scale|round)x\(.height/.scale|round)"' + echo $monitor | jq -r 'if (.transform % 2 == 0) then "\(.x),\(.y) \((.width / .scale | round))x\((.height / .scale | round))" else "\(.x),\(.y) \((.height / .scale | round))x\((.width / .scale | round))" end' } function grab_region() {