Last active
February 12, 2026 22:41
-
-
Save theanht1/74b4c12a16d2f24e6ea15284bfd9ec57 to your computer and use it in GitHub Desktop.
Amethyst layout for 2 overlapped columns, adjust the setting in `initialState`
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function layout() { | |
| return { | |
| name: "TwoOverlappedColumns", | |
| initialState: { | |
| mainPaneRatio: 0.5, | |
| overlapPixels: 144, | |
| }, | |
| recommendMainPaneRatio: (ratio, state) => { | |
| return { ...state, mainPaneRatio: ratio }; | |
| }, | |
| getFrameAssignments: (windows, screenFrame, state) => { | |
| const frameWidth = Math.round( | |
| screenFrame.width / 2 + state.overlapPixels | |
| ); | |
| return windows.reduce((frames, window, index) => { | |
| if (index % 2 === 0) { | |
| const frame = { | |
| x: screenFrame.x, | |
| y: screenFrame.y, | |
| width: frameWidth, | |
| height: screenFrame.height, | |
| isMain: true, | |
| unconstrainedDimension: "horizontal", | |
| }; | |
| return { ...frames, [window.id]: frame }; | |
| } else { | |
| const frame = { | |
| x: | |
| screenFrame.x + | |
| screenFrame.width * state.mainPaneRatio - | |
| state.overlapPixels, | |
| y: screenFrame.y, | |
| width: frameWidth, | |
| height: screenFrame.height, | |
| isMain: false, | |
| unconstrainedDimension: "horizontal", | |
| }; | |
| return { ...frames, [window.id]: frame }; | |
| } | |
| }, {}); | |
| }, | |
| }; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment