This repository has been archived by the owner on May 9, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.js
59 lines (51 loc) · 1.99 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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
const { app, BrowserWindow } = require("electron");
const path = require("path");
const { shell } = require("electron");
const os = require("os");
const ipc = require("electron").ipcMain;
const debug = false;
if (debug){
//Inspect Elements context menu
require("electron-context-menu")({
prepend: (params, browserWindow) => [{
label: "Rainbow",
visible: params.mediaType === "image"
}]
});
}
function getLogoPath(){
if (os.platform() === "darwin") return "/icon/icon.icns";
else if (os.platform() === "win32") return "/icon/icon.ico";
else return "/icon/icon.png";
}
function createWindowConfig(){
var conf = {
resizable: false,
width: 1000,
heigth: 600,
icon: __dirname + getLogoPath(),
show: false
};
return conf;
}
ipc.on("UI-windowID", function (event) { event.returnValue = win.id; });
app.setName("Commander IDE");
app.on("ready", () => {
console.log(
" ██╗ ██████╗ ███████╗\n" +
" ██║ ██╔══██╗ ██╔════╝\n" +
" ██║ ██║ ██║ █████╗ \n" +
" ██║ ██║ ██║ ██╔══╝ \n" +
" ██║ ██████╔╝ ███████╗\n" +
" ╚═╝ ╚═════╝ ╚══════╝\n" +
" ╔═╗╔╦╗╔═╗╦═╗╔╦╗╔═╗╔╦╗\n" +
" ╚═╗ ║ ╠═╣╠╦╝ ║ ║╣ ║║\n" +
" ╚═╝ ╩ ╩ ╩╩╚═ ╩ ╚═╝═╩╝\n"
);
win = new BrowserWindow(createWindowConfig());
win.setMenu(null);
win.loadURL(`file://${__dirname}/layouts/loader.html`);
win.on("ready-to-show", () => { win.show(); });
win.on("closed", () => { app.quit(); });
win.center();
});