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() {
74
74
local max_width=` hyprctl monitors -j | jq -r ' [.[] | if (.transform % 2 == 0) then (.x + .width) else (.x + .height) end] | max' `
75
75
local max_height=` hyprctl monitors -j | jq -r ' [.[] | if (.transform % 2 == 0) then (.y + .height) else (.y + .width) end] | max' `
76
76
77
+ local min_x=` hyprctl monitors -j | jq -r ' [.[] | (.x)] | min' `
78
+ local min_y=` hyprctl monitors -j | jq -r ' [.[] | (.y)] | min' `
79
+
77
80
local cropped_x=$x
78
81
local cropped_y=$y
79
82
local cropped_width=$width
@@ -86,13 +89,13 @@ function trim() {
86
89
cropped_height=$(( max_height - y))
87
90
fi
88
91
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 ))
92
95
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 ))
96
99
fi
97
100
98
101
local cropped=` printf " %s,%s %sx%s\n" \
You can’t perform that action at this time.
0 commit comments