diff --git a/package.json b/package.json index 01d0283..3875592 100644 --- a/package.json +++ b/package.json @@ -13,6 +13,8 @@ "dist", "!dist/app", "!dist/bundle", + "resources/cli/**/*", + "resources/common/**/*", "bin" ], "bin": { @@ -85,7 +87,9 @@ "dist/app/bundle", "dist/bundle", "!dist/app/package", - "!**/node_modules/**/*" + "!**/node_modules/**/*", + "resources/app/**/*", + "resources/common/**/*" ], "asar": false, "extraMetadata": { diff --git a/resources/app/menu-icon.png b/resources/app/menu-icon.png new file mode 100644 index 0000000..50d159f Binary files /dev/null and b/resources/app/menu-icon.png differ diff --git a/src/app/main/menu.ts b/src/app/main/menu.ts index 71e7840..110e2c8 100644 --- a/src/app/main/menu.ts +++ b/src/app/main/menu.ts @@ -1,4 +1,5 @@ import { app, dialog, Menu, Tray, nativeImage, MenuItem } from './electron.js'; +import path from 'node:path'; import createDebug from 'debug'; import { askAddNsoAccount, askAddPctlAccount } from './na-auth.js'; import { App } from './index.js'; @@ -6,20 +7,21 @@ import { WebService } from '../../api/coral-types.js'; import openWebService from './webservices.js'; import { SavedToken } from '../../common/auth/nso.js'; import { SavedMoonToken } from '../../common/auth/moon.js'; -import { dev } from '../../util/product.js'; +import { dev, dir } from '../../util/product.js'; import { EmbeddedPresenceMonitor, EmbeddedProxyPresenceMonitor } from './monitor.js'; const debug = createDebug('app:main:menu'); +const icon = nativeImage + .createFromPath(path.join(dir, 'resources', 'app', 'menu-icon.png')) + .resize({height: 16}); + +icon.setTemplateImage(true); + export default class MenuApp { - tray: Tray; + tray = new Tray(icon); constructor(readonly app: App) { - const icon = nativeImage.createEmpty(); - - this.tray = new Tray(icon); - - this.tray.setTitle('nxapi'); this.tray.setToolTip('nxapi'); app.store.on('update-nintendo-accounts', () => this.updateMenu());