Skip to content

Instantly share code, notes, and snippets.

@ecoleman
Created April 21, 2020 18:02
Show Gist options
  • Save ecoleman/9332081763df97c6902bc3dbc8940a02 to your computer and use it in GitHub Desktop.
Save ecoleman/9332081763df97c6902bc3dbc8940a02 to your computer and use it in GitHub Desktop.
Phoenix.set({
daemon: true,
openAtLogin: true,
})
var left = new Key('left', ['cmd', 'alt'], function() {
const parent = Screen.main().visibleFrame()
const win = Window.focused()
const frame = win.screen().frame()
win.setFrame({
x: frame.x,
y: frame.y,
width: parent.width/2,
height: parent.height,
})
})
//
// Left Side, 2/3rds of screen
//
var left_23rds = new Key('left', ['shift', 'cmd', 'alt'], function() {
const parent = Screen.main().visibleFrame()
const win = Window.focused()
const frame = win.screen().frame()
win.setFrame({
x: frame.x,
y: frame.y,
width: (parent.width/3) * 2,
height: parent.height,
})
})
var right = new Key('right', ['cmd', 'alt'], function() {
const parent = Screen.main().visibleFrame()
const win = Window.focused()
const frame = win.screen().frame()
win.setFrame({
x: frame.x + (frame.width/2),
y: frame.y,
width: parent.width/2,
height: parent.height,
})
})
//
// Right Side, 2/3rds of screen
//
var right_23rds = new Key('right', ['shift', 'cmd', 'alt'], function() {
const parent = Screen.main().visibleFrame()
const win = Window.focused()
const frame = win.screen().frame()
win.setFrame({
x: frame.x + (frame.width/3),
y: frame.y,
width: (parent.width/3) * 2,
height: parent.height,
})
})
var full = new Key('down', ['ctrl', 'cmd', 'alt'], function() {
const parent = Screen.main().visibleFrame()
const win = Window.focused()
const frame = win.screen().frame()
win.setFrame({
x: frame.x,
y: frame.y,
width: parent.width,
height: parent.height,
})
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment