From 66f33a2a7554cac97d3f9a58857fa944d77ff5ae Mon Sep 17 00:00:00 2001 From: kraftwerk28 Date: Tue, 19 Apr 2022 22:37:29 +0300 Subject: [PATCH] Consider titlebar in grimshot window mode --- contrib/grimshot | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/contrib/grimshot b/contrib/grimshot index 4ce31f29f..b30599d72 100755 --- a/contrib/grimshot +++ b/contrib/grimshot @@ -129,7 +129,10 @@ elif [ "$SUBJECT" = "output" ] ; then OUTPUT=$(swaymsg -t get_outputs | jq -r '.[] | select(.focused)' | jq -r '.name') WHAT="$OUTPUT" elif [ "$SUBJECT" = "window" ] ; then - GEOM=$(swaymsg -t get_tree | jq -r '.. | select(.pid? and .visible?) | .rect | "\(.x),\(.y) \(.width)x\(.height)"' | slurp) + GEOM=$(swaymsg -t get_tree | jq -r \ + '.. | select(.pid? and .visible?) + | "\(.rect.x),\(.rect.y - .deco_rect.height) \(.rect.width)x\(.rect.height + .deco_rect.height)"' \ + | slurp) # Check if user exited slurp without selecting the area if [ -z "$GEOM" ]; then exit 1