fix(hyprland): resolve desc: monitor names before generating config
Extract shared resolveMonitorNames to backend package so both Hyprland and Sway backends resolve desc: prefixed names to actual connector names before applying monitor layout. Previously the Hyprland backend wrote desc:... literally into monitors.conf, which Hyprland ignores, causing monitors to be positioned incorrectly or not configured at all.
This commit is contained in:
@@ -93,6 +93,12 @@ func (h *hyprlandBackend) GetMonitors(ctx context.Context) ([]MonitorInfo, error
|
||||
// ApplyLayout writes the monitor configuration file and calls hyprctl reload.
|
||||
// The config is written atomically (temp file + rename) to prevent corruption.
|
||||
func (h *hyprlandBackend) ApplyLayout(ctx context.Context, monitors []MonitorConfig) error {
|
||||
var err error
|
||||
monitors, err = resolveMonitorNames(ctx, monitors, h.GetMonitors, h.logger)
|
||||
if err != nil {
|
||||
return fmt.Errorf("resolve monitor names: %w", err)
|
||||
}
|
||||
|
||||
content := h.generateConf(monitors)
|
||||
|
||||
destPath, err := h.resolveOutputPath()
|
||||
|
||||
Reference in New Issue
Block a user