From 21b0a36fe7d5c683cd07f1f6a725c71784a3f9c0 Mon Sep 17 00:00:00 2001 From: Leaced Date: Fri, 24 Mar 2023 18:14:27 +0100 Subject: [PATCH] more readable --- .config/sway/screenshot.sh | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/.config/sway/screenshot.sh b/.config/sway/screenshot.sh index b46b4a8..ebd106c 100644 --- a/.config/sway/screenshot.sh +++ b/.config/sway/screenshot.sh @@ -9,13 +9,11 @@ all) #Screenshot of all outputs grim -t jpeg -q 100 $FILENAME ;; focus) # Screenshot of focused window - geometry="$( + geometry="$(echo $( swaymsg -t get_tree | grep -A 8 \"focused\"\:\ true | - grep -o "[0-9]*" | - awk ' - BEGIN{ RS = "" ; FS = "\n" } - {printf "%d,%d %dx%d", $2+$1,$3+$1,$4-2*$1,$5-2*$1}')" + grep -o "[0-9]*") | + awk '{printf "%d,%d %dx%d", $2+$1,$3+$1,$4-2*$1,$5-2*$1}')" grim -t jpeg -q 100 -g "$geometry" $FILENAME ;; choice) #Screenshot von Auswahl