-
Notifications
You must be signed in to change notification settings - Fork 0
Layouts
Layouts are used to describe a set of operations that run together that you can reference in the layout operation and the slate.default function. This page describes them in detail.
Layouts are created using the slate.layout function
var name = slate.layout(name, description);Layouts are used in the slate.default function
slate.default(screenConfig, layoutName);This will cause the layout with the name layoutName to be activated when Slate sees the screen configuration described by screenConfig.
Layouts can also be used in the slate.operation function along with the layout operation
var layoutOperation = slate.operation("layout", layoutName);This will create an operation that activates the layout with the name layoutName.
When creating layouts using the slate.layout function, two parameters are needed: the name of the layout and a hash containing the description of the layout.
The layout name should be a String and cannot be undefined. e.g. "myLayout"
The layout description should be a hash (cannot be undefined) in the following form:
{
app : params,
app : params,
...
}The name of the Application. This must be a String. e.g. "iTerm"
You may also specify one of the following special application names:
-
"_before_"- this specifies what to do before the layout is activated -
"_after_"- this specifies what to do after the layout is activated
A hash that contains a description of what to do with the Application.
{
"operations" : arrayOfOperationsOrFunctions,
"repeat" : repeat,
"repeat-last" : repeatLast,
"ignore-fail" : ignoreFail,
"main-first" : mainFirst,
"main-last" : mainLast,
"sort-title" : sortTitle,
"title-order" : titleOrder,
"title-order-regex" : titleOrderRegex
}