<commit_before>'use strict';

const electron = require('electron');
const app = electron.app;
const BrowserWindow = electron.BrowserWindow;
const Tray = electron.Tray;

let mainWindow = null;
let appIcon = null;
app.commandLine.appendSwitch('enable-transparent-visuals');
app.on('ready', () => {
  mainWindow = new BrowserWindow({
                                  width: 300,
                                  height: 400,
                                  frame: false,
                                  x: 1000,
                                  y: 0
                                  });
  appIcon = new Tray('assets/krypton.jpeg');

  mainWindow.webContents.openDevTools();

  mainWindow.loadURL(`file://${__dirname}/index.html`);
});

const windowEvents = {
  renderPomo(){
    mainWindow.maximize();
    mainWindow.setResizable(false);
    mainWindow.setMovable(false);
    mainWindow.setMinimizable(false);
    mainWindow.setClosable(true);
    mainWindow.setAlwaysOnTop(true);
    mainWindow.setSkipTaskbar(true);
    mainWindow.setIgnoreMouseEvents(true);
    mainWindow.setVisibleOnAllWorkspaces(true);
    mainWindow.setAutoHideMenuBar(true);
  },

  renderMain() {
    mainWindow.setBounds({width: 300,
                          height: 400,
                          frame: false,
                          x: 1000,
                          y: 0
                          });
    mainWindow.setResizable(true);
    mainWindow.setMovable(true);
    mainWindow.setClosable(true);
    mainWindow.setAlwaysOnTop(false);
    mainWindow.setSkipTaskbar(false);
    mainWindow.setClosable(true);
    mainWindow.setIgnoreMouseEvents(false);
    mainWindow.setVisibleOnAllWorkspaces(false);
    mainWindow.setAutoHideMenuBar(false);
  }
};


exports.windowEvents = windowEvents;
<commit_msg>tray icon now opens and closes app<commit_after>'use strict';

const electron = require('electron');
const app = electron.app;
const BrowserWindow = electron.BrowserWindow;
const Tray = electron.Tray;

let mainWindow = null;
let appIcon = null;
let active = true;

app.commandLine.appendSwitch('enable-transparent-visuals');
app.on('ready', () => {
  mainWindow = new BrowserWindow({
                                  width: 300,
                                  height: 400,
                                  frame: false,
                                  x: 1000,
                                  y: 0
                                  });
  appIcon = new Tray('assets/krypton.jpeg');

  appIcon.on('click', function(){
    active = !active;
    active ? windowEvents.renderMain() : windowEvents.hideMain();
  });

  mainWindow.webContents.openDevTools();

  mainWindow.loadURL(`file://${__dirname}/index.html`);
});



const windowEvents = {
  renderPomo(){
    mainWindow.maximize();
    mainWindow.setResizable(false);
    mainWindow.setMovable(false);
    mainWindow.setMinimizable(false);
    mainWindow.setClosable(true);
    mainWindow.setAlwaysOnTop(true);
    mainWindow.setSkipTaskbar(true);
    mainWindow.setIgnoreMouseEvents(true);
    mainWindow.setVisibleOnAllWorkspaces(true);
    mainWindow.setAutoHideMenuBar(true);
  },

  renderMain() {
    mainWindow.setBounds({width: 300,
                          height: 400,
                          frame: false,
                          x: 1000,
                          y: 0
                          });
    mainWindow.setResizable(true);
    mainWindow.setMovable(true);
    mainWindow.setClosable(true);
    mainWindow.setAlwaysOnTop(false);
    mainWindow.setSkipTaskbar(false);
    mainWindow.setClosable(true);
    mainWindow.setIgnoreMouseEvents(false);
    mainWindow.setVisibleOnAllWorkspaces(false);
    mainWindow.setAutoHideMenuBar(false);
    mainWindow.show();
  },

  hideMain() {
    mainWindow.hide();
  }
};


exports.windowEvents = windowEvents;

{'fraction_non_alphanumeric': 0.11224223440354998, 'fraction_numerical': 0.011485251892456277, 'mean_word_length': 2.180082987551867, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 12, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5642217', 'n_tokens_mistral': 1153, 'n_tokens_neox': 1065, 'n_words': 169}