@@ -68,9 +68,11 @@ func SetupOverlayWindow(appClass string) {
6868 fmt .Sprintf ("%s, size %d %d" , match , w , h ),
6969 match + ", move 0 0" ,
7070 }
71- for _ , rule := range rules {
72- exec .Command ("hyprctl" , "keyword" , "windowrule" , rule ).Run ()
71+ batch := make ([]string , len (rules ))
72+ for i , rule := range rules {
73+ batch [i ] = "keyword windowrule " + rule
7374 }
75+ exec .Command ("hyprctl" , "--batch" , strings .Join (batch , " ; " )).Run ()
7476}
7577
7678// hyprlandMonitorSize returns the effective (scaled) pixel dimensions of the
@@ -89,26 +91,20 @@ func hyprlandMonitorSize() (int, int) {
8991 if json .Unmarshal (out , & monitors ) != nil {
9092 return 1920 , 1080
9193 }
92- for _ , m := range monitors {
93- if m .Focused {
94- s := m .Scale
95- if s <= 0 {
96- s = 1
97- }
98- return int (math .Round (float64 (m .Width ) / s )),
99- int (math .Round (float64 (m .Height ) / s ))
94+ // Prefer the focused monitor, fall back to first.
95+ m := monitors [0 ]
96+ for _ , mon := range monitors {
97+ if mon .Focused {
98+ m = mon
99+ break
100100 }
101101 }
102- if len (monitors ) > 0 {
103- m := monitors [0 ]
104- s := m .Scale
105- if s <= 0 {
106- s = 1
107- }
108- return int (math .Round (float64 (m .Width ) / s )),
109- int (math .Round (float64 (m .Height ) / s ))
102+ s := m .Scale
103+ if s <= 0 {
104+ s = 1
110105 }
111- return 1920 , 1080
106+ return int (math .Round (float64 (m .Width ) / s )),
107+ int (math .Round (float64 (m .Height ) / s ))
112108}
113109
114110// filteredEnv returns a copy of the current environment with LD_PRELOAD removed.
0 commit comments