Last active
February 10, 2020 08:26
-
-
Save yvesvanbroekhoven/e2d65f4c98ed14b7331d3b2ec20bd24a to your computer and use it in GitHub Desktop.
Phoenix Window Manager configuration
This file contains hidden or 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
/** | |
* Useful links: | |
* | |
* INSTALL: | |
* - https://github.com/kasper/phoenix#install | |
* | |
* API DOCS | |
* - https://github.com/kasper/phoenix/blob/master/docs/API.md | |
* | |
* EXAMPLE CONFIGURATIONS | |
* - https://github.com/kasper/phoenix/wiki | |
* - https://github.com/Jaredk3nt/phoenix-padding | |
*/ | |
Phoenix.set({ | |
daemon: true, | |
openAtLogin: true, | |
}); | |
const ACTION_KEYS = [ 'control', 'option' ]; | |
var mainScreenSize = Screen.main().flippedVisibleFrame(); | |
const positions = { | |
bottomCentered: function() { | |
Window.focused().setFrame({ | |
height: (mainScreenSize.height / 5) * 2, | |
x: mainScreenSize.width / 4, | |
y: (mainScreenSize.height / 5) * 3.1, | |
width: mainScreenSize.width / 2, | |
}); | |
}, | |
bottomHalf: function() { | |
Window.focused().setFrame({ | |
height: mainScreenSize.height / 2, | |
x: 0, | |
y: mainScreenSize.height / 2, | |
width: mainScreenSize.width, | |
}); | |
}, | |
leftHalf: function() { | |
Window.focused().setFrame({ | |
height: mainScreenSize.height, | |
x: 0, | |
y: 0, | |
width: mainScreenSize.width / 2, | |
}); | |
}, | |
leftThird: function() { | |
Window.focused().setFrame({ | |
height: mainScreenSize.height, | |
x: 0, | |
y: 0, | |
width: (mainScreenSize.width / 3) * 2, | |
}); | |
}, | |
rightHalf: function() { | |
Window.focused().setFrame({ | |
height: mainScreenSize.height, | |
x: mainScreenSize.width / 2, | |
y: 0, | |
width: mainScreenSize.width / 2, | |
}); | |
}, | |
rightThird: function() { | |
Window.focused().setFrame({ | |
height: mainScreenSize.height, | |
x: mainScreenSize.width / 3, | |
y: 0, | |
width: (mainScreenSize.width / 3) * 2, | |
}); | |
}, | |
topCentered: function() { | |
Window.focused().setFrame({ | |
height: (mainScreenSize.height / 5) * 2, | |
x: mainScreenSize.width / 4, | |
y: 0, | |
width: mainScreenSize.width / 2, | |
}); | |
}, | |
topHalf: function() { | |
Window.focused().setFrame({ | |
height: mainScreenSize.height / 2, | |
x: 0, | |
y: 0, | |
width: mainScreenSize.width, | |
}); | |
}, | |
}; | |
var keypad1 = new Key('keypad1', ACTION_KEYS, function(){}); | |
var keypad2 = new Key('keypad2', ACTION_KEYS, positions.bottomCentered); | |
var keypad3 = new Key('keypad3', ACTION_KEYS, function(){}); | |
var keypad4 = new Key('keypad4', ACTION_KEYS, positions.leftThird); | |
var keypad5 = new Key('keypad5', ACTION_KEYS, function(){}); | |
var keypad6 = new Key('keypad6', ACTION_KEYS, positions.rightThird); | |
var keypad7 = new Key('keypad7', ACTION_KEYS, function(){}); | |
var keypad8 = new Key('keypad8', ACTION_KEYS, positions.topCentered); | |
var keypad9 = new Key('keypad9', ACTION_KEYS, function(){}); | |
var down = new Key('down', ACTION_KEYS, positions.bottomHalf); | |
var left = new Key('left', ACTION_KEYS, positions.leftHalf); | |
var l = new Key('l', ACTION_KEYS, positions.leftThird); | |
var right = new Key('right', ACTION_KEYS, positions.rightHalf); | |
var r = new Key('r', ACTION_KEYS, positions.rightThird); | |
var up = new Key('up', ACTION_KEYS, positions.topHalf); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment