diff --git a/assets/icon.png b/assets/icon.png new file mode 100644 index 0000000..fa52cf5 Binary files /dev/null and b/assets/icon.png differ diff --git a/main.js b/main.js index 8605e03..d84018a 100644 --- a/main.js +++ b/main.js @@ -29,13 +29,21 @@ let mainWindow let tray function createWindow () { + let appIcon = ''; + if (require('os').platform() === 'win32') { + appIcon = __dirname + '/assets/icon.ico'; + } else { + appIcon = __dirname + '/assets/icon.png'; + } + // Create the browser window. mainWindow = new BrowserWindow({ width: 800, height: 720, webPreferences: { nodeIntegration: true - } + }, + icon: appIcon }) mainWindow.setOpacity(0.95); @@ -77,7 +85,7 @@ function createWindow () { } ]); - tray = new Tray(__dirname + '/assets/icon.ico'); + tray = new Tray(appIcon); tray.setContextMenu(contextMenu); tray.setIgnoreDoubleClickEvents(true); tray.on('click', function() {