Skip to content

Commit 71af7e2

Browse files
committed
Update app.js to work better for macOS, added a 512px icon for mac
1 parent 16db809 commit 71af7e2

File tree

6 files changed

+49
-2
lines changed

6 files changed

+49
-2
lines changed

.DS_Store

6 KB
Binary file not shown.

README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,11 @@ or
3333
npm run build
3434
```
3535

36+
### if Electron-Builder fails (install as a Global Package)
37+
```
38+
npm install -g electron-builder
39+
```
40+
3641
Bineries get built in the ```./dist``` Directory
3742

3843
### Requirements

assets/.DS_Store

6 KB
Binary file not shown.

assets/GrokDesktop_DS_512_Icon.png

3.12 KB
Loading

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
"clean:win": "",
1111
"clean:linux": "",
1212
"prebuild": "rimraf --glob ./dists/*",
13-
"build": "sudo npm run prebuild && sudo electron-builder"
13+
"build": "npm run prebuild && electron-builder"
1414
},
1515
"build": {
1616
"appId": "com.ashleychapman.wrapper.grokdesktop",
@@ -29,6 +29,7 @@
2929
]
3030
},
3131
"mac": {
32+
"icon": "./assets/GrokDesktop_DS_512_Icon.png",
3233
"target": [
3334
{
3435
"target": "dmg",

src/app.js

Lines changed: 42 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
const { app, session, BrowserWindow, globalShortcut, ipcMain } = require('electron');
1+
const { app, session, BrowserWindow, globalShortcut, ipcMain, Menu } = require('electron');
22
const path = require('path');
33
const { screen } = require('electron');
44

@@ -79,8 +79,49 @@ app.whenReady().then(() => {
7979
app.on('activate', function () {
8080
if (BrowserWindow.getAllWindows().length === 0) createWindow()
8181
})
82+
83+
const template = [
84+
{
85+
label: app.getName(),
86+
submenu: [
87+
{
88+
label: 'About ' + app.getName(),
89+
role: 'about'
90+
},
91+
{ type: 'separator' },
92+
{
93+
label: 'Hide ' + app.getName(),
94+
accelerator: 'Command+H',
95+
role: 'hide'
96+
},
97+
{
98+
label: 'Hide Others',
99+
accelerator: 'Command+Shift+H',
100+
role: 'hideOthers'
101+
},
102+
{
103+
label: 'Show All',
104+
role: 'unhide'
105+
},
106+
{ type: 'separator' },
107+
{
108+
label: 'Quit',
109+
accelerator: 'Command+Q',
110+
click: () => {
111+
app.quit();
112+
}
113+
}
114+
]
115+
}
116+
];
117+
const menu = Menu.buildFromTemplate(template);
118+
Menu.setApplicationMenu(menu);
82119
})
83120

121+
app.on('ready', () => {
122+
Menu.setApplicationMenu(null);
123+
});
124+
84125
app.on('window-all-closed', function () {
85126
if (process.platform !== 'darwin') app.quit()
86127
})

0 commit comments

Comments
 (0)