-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.js
44 lines (38 loc) · 1.04 KB
/
index.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
40
41
42
43
44
'use strict';
const electron = require('electron');
var menubar = require('menubar');
var mb = menubar({dir:__dirname, tooltip: "Glyphilectron", icon:__dirname + "/res/icon.png", width:400, height:500});
const contextMenu = electron.Menu.buildFromTemplate([
{
label: 'About',
click() {
electron.dialog.showMessageBox({title: "Glyphilectron", type:"info", message: "Find Bootstrap Glyphicons right from the menubar/tray. \nMIT Copyright (c) 2016 Amit Merchant <bullredeyes@gmail.com>", buttons: ["Close"] });
}
},
{
label: 'Website',
click() {
electron.shell.openExternal("https://github.com/amitmerchant1990/glyphilectron");
}
},
{
type: 'separator'
},
{
label: 'Quit',
click() {
mb.app.quit();
}
}
]);
mb.on('ready', function ready () {
global.sharedObj = {
hide: mb.hideWindow,
quit: mb.app.quit,
pinned: false
}
console.log('Glyphilectron is ready to serve in the menubar.');
if (process.platform == 'win32') {
mb.tray.setContextMenu(contextMenu);
}
});