aboutsummaryrefslogtreecommitdiff
path: root/src/modules/ipc.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/modules/ipc.js')
-rw-r--r--src/modules/ipc.js32
1 files changed, 32 insertions, 0 deletions
diff --git a/src/modules/ipc.js b/src/modules/ipc.js
new file mode 100644
index 0000000..55737b7
--- /dev/null
+++ b/src/modules/ipc.js
@@ -0,0 +1,32 @@
+const win = require("../win");
+const { app, ipcMain } = require("electron");
+
+const kill = require("./kill");
+const settings = require("./settings");
+const is_running = require("./is_running");
+
+ipcMain.on("exit", () => {
+ if (settings().originkill) {
+ is_running.origin().then((running) => {
+ if (running) {
+ kill.origin().then(process.exit(0));
+ } else {
+ process.exit(0) ;
+ }
+ })
+ } else {
+ process.exit(0);
+ }
+})
+
+ipcMain.on("minimize", () => {
+ win().minimize();
+})
+
+ipcMain.on("relaunch", () => {
+ app.relaunch({
+ args: process.argv.slice(1)
+ })
+
+ app.exit(0);
+})