Spawn and Position a Window

Spawn and Position a Window

You can control the size/position of each show window you create, but you'll need some info from the current screen (especially with a multi-monitor setup!) to be able to position the window where you want it:

let width = 480
let height = 320
let { workArea } = await getActiveScreen()
let { x, y, width: workAreaWidth } = workArea
show(
md(`
# I'm in the top right of the current screen!
<div class="flex justify-center text-9xl">
šŸ˜˜
</div>
`),
{
width,
height,
x: x + workAreaWidth - width,
y: y,
}
)
Discuss Post