Created
April 27, 2018 07:34
-
-
Save andyHa/39266a71dc2e317005e8325dd09e2f80 to your computer and use it in GitHub Desktop.
My phoenix config
This file contains 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
// Debug using log stream --process Phoenix | |
new Key('right', [ 'ctrl', 'cmd' ], function () { | |
var wnd = Window.focused(); | |
if (!wnd) { | |
return; | |
} | |
if (!wnd.screen()) { | |
return; | |
} | |
var sortedScreens = Screen.all().sort((a, b) => a.frame().x < b.frame().x) | |
var index = sortedScreens.indexOf(wnd.screen()); | |
if (index < 1) { | |
wnd.setFrame(wnd.screen().flippedVisibleFrame()); | |
return; | |
} | |
wnd.setFrame(sortedScreens[index - 1].flippedVisibleFrame()); | |
}); | |
new Key('left', [ 'ctrl', 'cmd' ], function () { | |
var wnd = Window.focused(); | |
if (!wnd) { | |
return; | |
} | |
if (!wnd.screen()) { | |
return; | |
} | |
var sortedScreens = Screen.all().sort((a, b) => a.frame().x < b.frame().x) | |
var index = sortedScreens.indexOf(wnd.screen()); | |
if (index < 0 || index == sortedScreens.length - 1) { | |
wnd.setFrame(wnd.screen().flippedVisibleFrame()); | |
return; | |
} | |
wnd.setFrame(sortedScreens[index + 1].flippedVisibleFrame()); | |
}); | |
new Key('up', [ 'ctrl', 'cmd' ], function () { | |
var wnd = Window.focused(); | |
wnd.setFrame(wnd.screen().flippedVisibleFrame()); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment