File tree Expand file tree Collapse file tree 1 file changed +9
-6
lines changed Expand file tree Collapse file tree 1 file changed +9
-6
lines changed Original file line number Diff line number Diff line change @@ -74,6 +74,9 @@ function trim() {
7474 local max_width=` hyprctl monitors -j | jq -r ' [.[] | if (.transform % 2 == 0) then (.x + .width) else (.x + .height) end] | max' `
7575 local max_height=` hyprctl monitors -j | jq -r ' [.[] | if (.transform % 2 == 0) then (.y + .height) else (.y + .width) end] | max' `
7676
77+ local min_x=` hyprctl monitors -j | jq -r ' [.[] | (.x)] | min' `
78+ local min_y=` hyprctl monitors -j | jq -r ' [.[] | (.y)] | min' `
79+
7780 local cropped_x=$x
7881 local cropped_y=$y
7982 local cropped_width=$width
@@ -86,13 +89,13 @@ function trim() {
8689 cropped_height=$(( max_height - y))
8790 fi
8891
89- if (( x < 0 )) ; then
90- cropped_x=0
91- cropped_width=$(( cropped_width + x))
92+ if (( x < min_x )) ; then
93+ cropped_x=" $min_x "
94+ cropped_width=$(( cropped_width + x - min_x ))
9295 fi
93- if (( y < 0 )) ; then
94- cropped_y=0
95- cropped_height=$(( cropped_height + y))
96+ if (( y < min_y )) ; then
97+ cropped_y=" $min_y "
98+ cropped_height=$(( cropped_height + y - min_y ))
9699 fi
97100
98101 local cropped=` printf " %s,%s %sx%s\n" \
You can’t perform that action at this time.
0 commit comments