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