Last active
May 16, 2018 09:11
-
-
Save umara123/28c293f2ada701ba7deceb72fc2cc3cd to your computer and use it in GitHub Desktop.
Install and set up Slate to set position of Simulator and Emulator
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
| cd /Applications && curl http://www.ninjamonkeysoftware.com/slate/versions/slate-latest.tar.gz | tar -xz | |
| cd ~ | |
| cat > .slate.js << EOF | |
| var pushRight = slate.operation("push", { | |
| "direction" : "right", | |
| "style" : "bar-resize:screenSizeX/3" | |
| }); | |
| var pushRightTab = slate.operation("push", { | |
| "direction" : "right", | |
| "style" : "bar-resize:screenSizeX/2" | |
| }); | |
| var pushLeft = slate.operation("push", { | |
| "direction" : "left", | |
| "style" : "bar-resize:screenSizeX/2" | |
| }); | |
| var pushLeftTab = slate.operation("push", { | |
| "direction" : "left", | |
| "style" : "bar-resize:screenSizeX/3" | |
| }); | |
| var pushTop = slate.operation("push", { | |
| "direction" : "top", | |
| "style" : "bar-resize:screenSizeY/2" | |
| }); | |
| var fullscreen = slate.operation("move", { | |
| "x" : "screenOriginX", | |
| "y" : "screenOriginY", | |
| "width" : "screenSizeX", | |
| "height" : "screenSizeY" | |
| }); | |
| slate.on("windowOpened", function(event, win) { | |
| var appName = win.app().name(); | |
| var appTitle = win.title(); | |
| slate.log('Slate appName' + ' ' + appName) | |
| slate.log('Slate appTitle' + ' ' + appTitle) | |
| if (appName.includes("Simulator") && appTitle.includes("iPhone")) { | |
| win.doOperation(pushLeft); | |
| } else if (appName.includes("Simulator") && appTitle.includes("iPad")) { | |
| win.doOperation(pushLeftTab); | |
| }else if ((appName.includes("Android") || appName.includes("qemu")) && appTitle.includes("tablet")) { | |
| win.doOperation(pushRightTab); | |
| } else if (appName.includes("Android") || appName.includes("qemu")) { | |
| win.doOperation(pushRight); | |
| } | |
| }); | |
| EOF | |
| echo "" >> .bash_profile | |
| echo "open -a Slate" >> .bash_profile | |
| echo "DONE" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment