Bugfix for fullscreen

a bug caused images to be cropped in full-screen by some pixels
This commit is contained in:
Leaced 2023-03-25 23:21:28 +01:00 committed by GitHub
parent 4e2e518f08
commit ea2a9e0b45
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -9,11 +9,16 @@ all) #Screenshot of all outputs
grim -t jpeg -q 100 $FILENAME ;; grim -t jpeg -q 100 $FILENAME ;;
focus) # Screenshot of focused window focus) # Screenshot of focused window
geometry="$(echo $( geometry=$(
swaymsg -t get_tree | swaymsg -t get_tree |
grep -A 8 \"focused\"\:\ true | awk '
grep -o "[0-9]*") | BEGIN { ORS=" " };
awk '{printf "%d,%d %dx%d", $2+$1,$3+$1,$4-2*$1,$5-2*$1}')" lines_after&&lines_after-- {print $2+0}; #loop over n lines. Print only numbers
/focused": true/,/window_rect/ {
if($1=="\"window_rect\":") lines_after=4;
if($1=="\"rect\":") lines_after=2
}' |
awk '{printf "%d,%d %dx%d", $1+$3,$2+$4,$5,$6}')
grim -t jpeg -q 100 -g "$geometry" $FILENAME ;; grim -t jpeg -q 100 -g "$geometry" $FILENAME ;;
choice) #Screenshot von Auswahl choice) #Screenshot von Auswahl