2022-01-15 21:21:51 +00:00
|
|
|
import { app, Menu, Tray } from 'electron';
|
2021-12-26 18:58:05 +00:00
|
|
|
import {mainWindow} from './main';
|
2022-01-16 18:07:00 +00:00
|
|
|
import * as path from 'path'
|
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();
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
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-01-16 18:07:00 +00:00
|
|
|
tray.setToolTip('ArmCord ' + process.env.npm_package_version)
|
2021-12-26 18:58:05 +00:00
|
|
|
tray.setContextMenu(contextMenu)
|
|
|
|
})
|