Files
dotfiles/config/amethyst/layouts/almost-maximize.js
Ismo Vuorinen 961efec364 feat: switch to biome, apply formatting, shellcheck (#227)
* feat: switch to biome, apply formatting, shellcheck
* chore: apply cr comments
* chore: few config tweaks, shellcheck hook now py-based
* chore: lint fixes and pr comments
* chore(lint): megalinter, and other fixes

Signed-off-by: Ismo Vuorinen <ismo@ivuorinen.net>
2025-12-17 16:03:29 +02:00

36 lines
950 B
JavaScript

/**
* Almost Maximize
* Almost maximizes the window to the screen, leaving a small margin.
*
* @author Ville Viklund <https://github.com/ville6000>
*
* @param {Object} windows - All windows in the current space.
* @param {Object} screenFrame - The frame of the current screen.
* @return {Object} - The frames for the windows in the current space.
*/
function layout() {
return {
name: 'Almost Maximize',
getFrameAssignments: (windows, screenFrame) => {
const width = screenFrame.width * 0.95
const height = screenFrame.height * 0.95
const x = (screenFrame.width - width) / 2
const y = (screenFrame.height - height) / 2
const windowFrames = {}
windows.forEach((window) => {
windowFrames[window.id] = {
Y: screenFrame.y + y,
x: screenFrame.x + x,
width,
height,
}
})
return windowFrames
},
}
}
module.exports = layout()