jigish/slate — pull request #387 by wincent (2014-03-08 06:01:51+00:00)
Title: Expose bundle identifier in app object

This can be useful to distinguish between apps like Chrome and Chrome
Canary (which both report their name as "Google Chrome" but have bundle
identifiers `com.google.Chrome` and `com.google.Chrome.canary`
respectively).

This can be used in a `.slate.js` to do things like the following,
which is a layout that pushes Canary windows to the left half of the
screen and normal Chrome windows to the right half:

slate.layout('my-layout', {
'Google Chrome': {
operations: [function(window) {
var app = window.app();
if (app.bundleIdentifier() === 'com.google.Chrome.canary') {
// code to push window left
} else {
// code to push window right
}
}],
repeat: true,
},
});