2022-01-15 21:21:51 +00:00
|
|
|
import { app, Menu, Tray } from 'electron';
|
2022-01-30 19:48:32 +00:00
|
|
|
import {mainWindow} from './window';
|
2022-01-16 18:07:00 +00:00
|
|
|
import * as path from 'path'
|
2022-02-26 21:26:16 +00:00
|
|
|
import { createSettingsWindow } from './settings/main';
|
2021-12-26 18:58:05 +00:00
|
|
|
let tray = null
|
|
|
|
app.whenReady().then(() => {
|
2022-01-16 18:07:00 +00:00
|
|
|
tray = new Tray(path.join(__dirname, "../", "/assets/ac_plug.png"))
|
2021-12-26 18:58:05 +00:00
|
|
|
const contextMenu = Menu.buildFromTemplate([
|
|
|
|
{
|
|
|
|
label: "Open ArmCord",
|
|
|
|
click: function () {
|
|
|
|
mainWindow.show();
|
|
|
|
},
|
|
|
|
},
|
2022-02-26 21:26:16 +00:00
|
|
|
{
|
|
|
|
label: "Open Settings",
|
|
|
|
click: function () {
|
|
|
|
createSettingsWindow();
|
|
|
|
},
|
|
|
|
},
|
2021-12-26 18:58:05 +00:00
|
|
|
{
|
|
|
|
label: "Support Discord Server",
|
|
|
|
click: function () {
|
|
|
|
mainWindow.show();
|
|
|
|
mainWindow.loadURL("https://discord.gg/F25bc4RYDt");
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
label: "Quit ArmCord",
|
|
|
|
click: function () {
|
|
|
|
app.quit();
|
|
|
|
},
|
|
|
|
},
|
|
|
|
]);
|
2022-01-15 21:21:51 +00:00
|
|
|
|
2022-02-18 20:20:48 +00:00
|
|
|
tray.setToolTip('ArmCord ' + app.getVersion())
|
2021-12-26 18:58:05 +00:00
|
|
|
tray.setContextMenu(contextMenu)
|
2022-02-18 20:20:48 +00:00
|
|
|
})
|