kasper / phoenix

A lightweight macOS window and app manager scriptable with JavaScript
https://kasper.github.io/phoenix/
Other
4.36k stars 128 forks source link

How to resize window to 50% #253

Closed olimart closed 4 years ago

olimart commented 4 years ago

Was wondering if you could provide an example on how to move the current window (top left) & resize it to half width of the window & 100% vertically?

Great application by the way. Thanks.

kasper commented 4 years ago

@olimart Hi! Thanks for the kind words. 😄 Of course! You could do something like this. Hope it helps.

Key.on('e', ['control', 'shift'], () => {
  const window = Window.focused();
  if (window) {
    window.setFrame({
      x: 0,
      y: 0,
      width: window.size().width / 2,
      height: window.size().height,
    });
  }
});
olimart commented 4 years ago

Thank you very much.