const centerColumnWidthFactor = 0.4; // Prioritizes center with adjustable width factor // Fills column left, then right // Then splits right column vertically // Then splits left column vertically function layout() { return { name: "Ultrawide Simple", getFrameAssignments: (windows, screenFrame) => { const rowHeight = screenFrame.height / 2; const centerColumnWidth = screenFrame.width * centerColumnWidthFactor; const sideColumnWidth = (screenFrame.width - centerColumnWidth) / 2; const frames = windows.map((window, index) => { let frame; const definitions = { 1: { 0: { x: 1, y: 0, h: 2 }, }, 2: { 0: { x: 1, y: 0, h: 2 }, 1: { x: 0, y: 0, h: 2 }, }, 3: { 0: { x: 1, y: 0, h: 2 }, 1: { x: 0, y: 0, h: 2 }, 2: { x: 2, y: 0, h: 2 }, }, 4: { 0: { x: 1, y: 0, h: 2 }, 1: { x: 0, y: 0, h: 2 }, 2: { x: 2, y: 0, h: 1 }, 3: { x: 2, y: 1, h: 1 }, }, 5: { 0: { x: 1, y: 0, h: 2 }, 1: { x: 0, y: 0, h: 1 }, 2: { x: 2, y: 0, h: 1 }, 3: { x: 2, y: 1, h: 1 }, 4: { x: 0, y: 1, h: 1 }, }, } let d = definitions[windows.length][index]; let width = d.x == 1 ? centerColumnWidth : sideColumnWidth; let x = d.x == 0 ? 0 : d.x == 1 ? sideColumnWidth : sideColumnWidth + centerColumnWidth; frame = { x: screenFrame.x + x, y: screenFrame.y + rowHeight * d.y, width: width, height: rowHeight * d.h, }; return { [window.id]: frame }; }); return frames.reduce((frames, frame) => ({ ...frames, ...frame }), {}); } }; }