<commit_before>'use strict';
const path = require('path');
const electron = require('electron');

const {app} = electron;
let tray = null;
let lastCounter = 0;

exports.create = win => {
	if (tray) {
		return;
	}

	let iconPath = '';

	if (process.platform === 'darwin')
		iconPath = getDarwinIconPath(0);
	else
		iconPath = path.join(__dirname, 'static/IconTray.png');

	const contextMenu = electron.Menu.buildFromTemplate([
		{
			label: 'Toggle',
			click() {
				win.toggle();
			}
		},
		{
			type: 'separator'
		},
		{
			role: 'quit'
		}
	]);

	tray = new electron.Tray(iconPath);
	tray.setToolTip(`${app.getName()}`);
	tray.setContextMenu(contextMenu);
	tray.on('click', () => {
		win.toggle()<commit_msg>Show context menu only on right click<commit_after>'use strict';
const path = require('path');
const electron = require('electron');

const {app} = electron;
let tray = null;
let lastCounter = 0;

exports.create = win => {
	if (tray) {
		return;
	}

	let iconPath = '';

	if (process.platform === 'darwin')
		iconPath = getDarwinIconPath(0);
	else
		iconPath = path.join(__dirname, 'static/IconTray.png');

	const contextMenu = electron.Menu.buildFromTemplate([
		{
			label: 'Toggle',
			click() {
				win.toggle();
			}
		},
		{
			type: 'separator'
		},
		{
			role: 'quit'
		}
	]);

	tray = new electron.Tray(iconPath);
	tray.setToolTip(`${app.getName()}`);

	tray.on('click', () => {
		win.toggle();
	});

	tray.on('right-click', () => {
		tray.popUpContextMenu(contextMenu);
{'fraction_non_alphanumeric': 0.1841929002009377, 'fraction_numerical': 0.0026791694574681848, 'mean_word_length': 3.7129337539432177, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 8, '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': '2505686', 'n_tokens_mistral': 608, 'n_tokens_neox': 542, 'n_words': 108}