From 83219fb8d3c69188a61b2392a60aab60816812b3 Mon Sep 17 00:00:00 2001 From: smartfridge <37928912+smartfrigde@users.noreply.github.com> Date: Sat, 8 May 2021 16:52:23 +0200 Subject: [PATCH] iconformat depending on os --- main.js | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/main.js b/main.js index 7b65f28..f24a492 100644 --- a/main.js +++ b/main.js @@ -2,9 +2,17 @@ const { app, BrowserWindow, session, Tray, Menu } = require("electron"); const path = require("path"); const contextMenu = require("electron-context-menu"); +const os = require("os"); require("v8-compile-cache"); require("./utils/updater"); +if (os.type() == 'Linux'){ + var iconformat = __dirname + "/discord.png" +} else { + console.log("Running Non-Linux") + var iconformat = __dirname + "/discord.ico"; +} + contextMenu({ prepend: (defaultActions, parameters, browserWindow) => [ { @@ -21,7 +29,7 @@ function createWindow() { mainWindow = new BrowserWindow({ width: 800, height: 600, - icon: __dirname + "/discord.ico", + icon: iconformat, title: "ArmCord", frame: false, webPreferences: { @@ -31,7 +39,7 @@ function createWindow() { }, }); - var appIcon = new Tray(__dirname + "/discord.ico"); + var appIcon = new Tray(iconformat); mainWindow.webContents.userAgent = "Mozilla/5.0 (X12; FreeBSD x86) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/74.0.3729.169 Safari/537.36"; //fake useragent mainWindow.loadFile("index.html");