<commit_before>slate.configAll({
  defaultToCurrentScreen: true,
});

// monitors
var internal = '1440x900';
var cinema   = '2560x1440';
var monitors = [internal, cinema];

// layouts
var oneMonitor  = 'one-monitor';
var twoMonitors = 'two-monitors';

// aliases to give us a DSL-like feel
var up          = 'up';
var right       = 'right';
var down        = 'down';
var left        = 'left';
var topRight    = 'top-right';
var bottomRight = 'bottom-right';
var bottomLeft  = 'bottom-left';
var topLeft     = 'top-left';
var second      = seconds = 1000;

// operations for layouts
var hideSpotify  = slate.operation('hide', { app: 'Spotify' });
var focusITerm   = slate.operation('focus', { app: 'iTerm' });
var focusTextual = slate.operation('focus', { app: 'Textual' });

function positionChrome(window) {
  var app = window.app();
  if (slate.screenCount() === 1) {
    window.doOperation(move(0).screen(internal));
  } else {
    if (typeof app.bundleIdentifier === 'function' &&
        app.bundleIdentifier() === 'com.google.Chrome.canary') {
      window.doOperation(push(left, 1 / 2).screen(cinema));
    } else {
      window.doOperation(push(right, 1 / 2).screen(cinema));
    }
  }
}

slate.layout('one-monitor', {
  _before_: { operations: [hideSpotify] },<commit_msg>Slate: only position first Chrome window<commit_after>slate.configAll({
  defaultToCurrentScreen: true,
});

// monitors
var internal = '1440x900';
var cinema   = '2560x1440';
var monitors = [internal, cinema];

// layouts
var oneMonitor  = 'one-monitor';
var twoMonitors = 'two-monitors';

// aliases to give us a DSL-like feel
var up          = 'up';
var right       = 'right';
var down        = 'down';
var left        = 'left';
var topRight    = 'top-right';
var bottomRight = 'bottom-right';
var bottomLeft  = 'bottom-left';
var topLeft     = 'top-left';
var second      = seconds = 1000;

// operations for layouts
var hideSpotify  = slate.operation('hide', { app: 'Spotify' });
var focusITerm   = slate.operation('focus', { app: 'iTerm' });
var focusTextual = slate.operation('focus', { app: 'Textual' });

function positionChrome(window) {
  if (window.hidden()) {
    return;
  }

  // only operate on first window; Chrome usually does something intelligent
  // with the rest
  var app = window.app();
  var windowCount = 0;
  app.eachWindow(function(w) {
    // for each new window we open, we actually get called twice; once with an
    // empty title (which we ignore) and once with the real thing
    if (w.title() !== '' && !w.hidden()) {
      windowCount++;
    }
  });
  if (windowCount > 1) {
    return;
  }

  if (slate.screenCount() === 1) {
    window.doOperation(move(0).screen(internal));
  } else {
    if (typeof app.bundleIdentifier === 'function' &&
        app.bundleIdentifier() === 'com.google.Chrome.canary') {
      window.doOperation(push(left, 1 / 2).screen(cinema));
    } else {
      window.doOperation(push(right, 1 / 2).screen(cinema));
    }
  }
}

slate.layout('one-monitor', {
  _before_: { operations: [hideSpotify] },
{'fraction_non_alphanumeric': 0.15867279894875164, 'fraction_numerical': 0.017082785808147174, 'mean_word_length': 3.276685393258427, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 4, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '579681', 'n_tokens_mistral': 1042, 'n_tokens_neox': 979, 'n_words': 260}