feat: support named switchable layouts

This commit is contained in:
Steve Cliff
2026-08-20 09:06:37 +01:00
parent 6ddecad74d
commit 45ee82692d
7 changed files with 172 additions and 30 deletions
+3 -3
View File
@@ -168,7 +168,7 @@ func Run(configPath string, cfg config.Config, debug bool) error {
}
defer procKillTimer.Call(0, shiftTimer)
log.Printf("ready: Shift+drag snapping=%v, overlay=%v, %d hotkeys", cfg.ShiftDrag, cfg.Overlay.Enabled, len(e.hotkeys))
log.Printf("ready: layout=%q, Shift+drag snapping=%v, overlay=%v, %d hotkeys", cfg.ActiveLayout, cfg.ShiftDrag, cfg.Overlay.Enabled, len(e.hotkeys))
logMonitors()
var msg message
for {
@@ -419,7 +419,7 @@ func (e *engine) snapAtCursor(hwnd windows.Handle) (bool, string) {
e.mu.RUnlock()
l, ok := cfg.LayoutFor(mi.device())
if !ok {
return false, fmt.Sprintf("no layout matches monitor %s and no wildcard layout exists", mi.device())
return false, fmt.Sprintf("active layout %q has no entry for monitor %s and no wildcard fallback", cfg.ActiveLayout, mi.device())
}
work := toLayoutRect(mi.Work)
zi := layout.ZoneAt(work, l.Zones, 0, layout.Point{X: p.X, Y: p.Y})
@@ -690,5 +690,5 @@ func (e *engine) reloadIfChanged() {
_ = e.registerHotkeys()
return
}
log.Printf("configuration reloaded")
log.Printf("configuration reloaded: active layout=%q", cfg.ActiveLayout)
}