-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathmain.js
39 lines (32 loc) · 774 Bytes
/
main.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
'use strict';
// DEPENDENCIES
const { ipcMain } = require('electron');
const menubar = require('menubar');
// NATIVE IMPORTS
const os = require('os');
const path = require('path');
// Global Variables
let mb;
let options = {
index: `file://${path.join(__dirname, '/app/index.html')}`,
width: 360,
height: 500,
tooltip: 'Dev 10',
preloadWindow: true
};
if (os.platform() === 'win32') {
options.icon = path.join(__dirname, '/icons/logowin.png');
mb = menubar(options);
} else {
options.icon = path.join(__dirname, '/icons/logoTemplate.png');
mb = menubar(options);
}
mb.on('ready', () => {
console.log('app is ready');
});
mb.on('after-show', () => {
mb.window.webContents.send('loadNewPosts');
});
ipcMain.on('quit', () => {
mb.app.quit();
});