-
Notifications
You must be signed in to change notification settings - Fork 17
/
Copy pathindex.js
41 lines (31 loc) · 881 Bytes
/
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
const { app, BrowserWindow } = require("electron");
const shortcut = require("electron-localshortcut");
let win;
// Set extensions for require
require.extensions[".pw"] = require.extensions[".js"];
let startup = () => {
win = new BrowserWindow({
title: "Glass",
width: 1280,
minWidth: 1024,
height: 720,
minHeight: 576,
backgroundColor: "#000",
autoHideMenuBar: true
});
win.loadURL(`file://${__dirname}/render/startup.html`);
// win.webContents.openDevTools()
shortcut.register(win, "Ctrl+W", () => {
return false;
});
win.on("closed", () => {
win = null;
});
// Change this to set your OS name
global.OS = "GlassOS";
};
app.on("ready", startup);
app.on("window-all-closed", () => app.quit());
app.on("activate", () => {
if (win === null) startup();
});