(feat): migrate bun to pnpm
(feat): some mtp stuff (wip): electron app tray
This commit is contained in:
parent
69149b73bd
commit
82a483d7ab
39 changed files with 10109 additions and 2429 deletions
25
apps/electron/src/main/tray.ts
Normal file
25
apps/electron/src/main/tray.ts
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
import { Tray, Menu } from "electron";
|
||||
import path from "node:path";
|
||||
import { fileURLToPath } from "node:url";
|
||||
|
||||
let tray: Tray | null = null;
|
||||
|
||||
const __filename = fileURLToPath(import.meta.url);
|
||||
const __dirname = path.dirname(__filename);
|
||||
|
||||
export function initTray() {
|
||||
const iconPath = path.join(__dirname, "../../build/icons/32x32.png");
|
||||
|
||||
tray = new Tray(iconPath); // keep reference alive
|
||||
|
||||
const contextMenu = Menu.buildFromTemplate([
|
||||
{ label: "Restart", type: "normal" },
|
||||
{ label: "Quit", type: "normal" },
|
||||
]);
|
||||
|
||||
tray.setContextMenu(contextMenu);
|
||||
|
||||
tray.on("click", (event) => {
|
||||
console.log(event);
|
||||
})
|
||||
}
|
||||
Loading…
Reference in a new issue