diff --git a/config.js b/config.js index 7d6a917..cfc3c7c 100644 --- a/config.js +++ b/config.js @@ -10,6 +10,7 @@ module.exports = new Config({ }, menuBarVisible: false, autoNightMode: false, + hideTray: false, darkMode: false, blackMode: false, sepiaMode: false, diff --git a/index.js b/index.js index 7db4212..be1b757 100644 --- a/index.js +++ b/index.js @@ -102,7 +102,11 @@ function createMainWindow() { app.on('ready', () => { electron.Menu.setApplicationMenu(appMenu); mainWindow = createMainWindow(); - tray.create(mainWindow); + if (!config.get('hideTray')) { + // Check whether or not the tray + // icon is set to be hidden + tray.create(mainWindow); + } const windowContent = mainWindow.webContents; windowContent.on('dom-ready', () => { diff --git a/menu.js b/menu.js index a7cf968..bd08cc6 100644 --- a/menu.js +++ b/menu.js @@ -824,6 +824,15 @@ const otherTpl = [{ config.set('alwaysOnTop', item.checked); focusedWindow.setAlwaysOnTop(item.checked); } + }, { + label: 'Hide Tray Icon', + type: 'checkbox', + checked: config.get('hideTray'), + click(item) { + config.set('hideTray', item.checked); + app.relaunch(); + app.quit(); + } }, { label: 'Toggle Menu Bar', type: 'checkbox', diff --git a/tray.js b/tray.js index 05e7b56..40f3189 100644 --- a/tray.js +++ b/tray.js @@ -110,6 +110,18 @@ exports.create = win => { } }, { type: 'separator' + }, { + label: 'Hide Tray Icon', + type: 'checkbox', + checked: config.get('hideTray'), + click(item) { + showWin(); + config.set('hideTray', item.checked); + app.relaunch(); + app.quit(); + } + }, { + type: 'separator' }, { label: `Settings`, click() {