Skip to content
2minemaster2 edited this page Aug 7, 2015 · 17 revisions

Example Slate Configs

User Configs

Inline Examples

Layout Definition Tricks

### use '|' and '>' in layout definitions
### eg. hide only the second instance of chrome but resize and move both
alias huge-main  move screenOriginX;screenOriginY                 screenSizeX;screenSizeY ${huge-monitor}
alias small-right move screenOriginX+screenSizeX/2;screenOriginY  screenSizeX/2;screenSizeY ${small-monitor}

layout 2monitors 'Google Chrome':SORT_TITLE     ${huge-main} | ${small-right} > hide current

### hide an app upon layout initialization
layout 2monitors 'Twitter':                     sequence focus down > hide current


### hide the second instance of an app
layout 2monitors 'Mail':SORT_TITLE              nudge +0 +0 > show current | nudge +0 +0 > hide current

Sequence Chains

### use sequences, focus, and pipes to switch 2 vertically split windows back and forth
bind 4:ctrl sequence push left bar-resize:screenSizeX/2 > focus right > push right bar-resize:screenSizeX/2 > push left > push right | push left

Fullscreen hacks

Slate doesn't handle applications in 'fullscreen' mode very well out of the box. The following applescript file will allow you to get an application out of fullscreen mode before doing subsequent operations on the app.

In the example below the file has been saved to ~/scripts/makeFullScreen.scpt - the example will take Chrome out of full screen mode and move it to the left part of the screen:

bind v:alt;cmd sequence shell wait path:~/scripts '/usr/bin/osascript -l AppleScript makeFullScreen.scpt Chrome false' | focus 'Chrome' | move screenOriginX;screenOriginY screenSizeX/2;screenSizeY

If you want to resize the windows to use the full screen you can bind this alias:

alias full move screenOriginX;screenOriginY screenSizeX;screenSizeY

Moving

If you want to move a window you need the command "bind" with the keys you want to use. With that you need the command "alias" to set what you want to do with the key-combination. Here a example:

bind return:cmd,alt ${full}

What this code do: You set the keys you want to use for the command you want to have. In this example return, command and alt. The variable ${full} is later important for the "alias".

Resizing

To change the size you need the command "alias" like that:

alias full move screenOriginX;screenOriginY screenSizeX;screenSizeY

First, you define alias. "Alias full move" shows the program that you want to define the key-combination "full". "move" says that you want to move the window to a side to a screen, the command "corner" is the other side. You use corner when you want the window in a corner of your display.

Second, you say where the window have to go. In this example you say "this window have to fill the complete display on the X- and Y-axis".

The "screenOriginY/screenOriginX" command says that you want the full size of the Y-axis and X-axsis. You can even use "resize" that you want to change the display pixels like that:

alias topleft corner top-left resize:screenSizeX/2;resize:screenSizeY/2

"top-left" only shows us that it has to be on the top and on the left side.

Focusing

Automagic Stuff