diff --git a/main.js b/main.js index 94f295b..c9a0efa 100644 --- a/main.js +++ b/main.js @@ -1,4 +1,4 @@ -const { app, globalShortcut, BrowserWindow } = require('electron'); +const { app, globalShortcut, ipcMain } = require('electron'); const { PanelWindow } = require('electron-panel-window'); let barWindow = null; @@ -9,23 +9,16 @@ app.on('ready', function() { width: 700, height: 100, show: false, - resizable: false, + // resizable: false, center: true, fullscreenable: false, - // frameless does not work in PanelWindow - // frame: false }); - // setVisibleOnAllWorkspaces crashes the app with PanelWindow - // barWindow.setVisibleOnAllWorkspaces(true, { visibleOnFullScreen: true }); - // barWindow.loadFile(`./main.html`); - // barWindow.loadURL(`file://${__dirname}/main.html`); barWindow.loadFile('src/bar/index.html'); - if (debug === false) { - barWindow.on('blur', function(event) { - console.log('BLUR'); - barWindow.hide(); - }); - } + + ipcMain.on('hide', (event, arg) => { + console.log('hide') + barWindow.hide() + }) const shortcut = 'Alt+CommandOrControl+Space' // 'CommandOrControl+Space' globalShortcut.register(shortcut, () => { diff --git a/package-lock.json b/package-lock.json index f7584e4..aa72495 100644 --- a/package-lock.json +++ b/package-lock.json @@ -301,6 +301,7 @@ "version": "1.5.0", "resolved": "https://registry.npmjs.org/bindings/-/bindings-1.5.0.tgz", "integrity": "sha512-p2q/t/mhvuOj/UeLlV6566GD/guowlr0hHxClI0W9m7MWYkL1F0hLo+0Aexs9HSPCtR1SXQ0TD3MMKrXZajbiQ==", + "dev": true, "requires": { "file-uri-to-path": "1.0.0" } @@ -998,12 +999,11 @@ } }, "electron-panel-window": { - "version": "2.0.0-1", - "resolved": "https://registry.npmjs.org/electron-panel-window/-/electron-panel-window-2.0.0-1.tgz", - "integrity": "sha512-srhcBXMt8+hDLwNvlmWzGyRvvEtJQbgL4bgJjKqzyipZBI4P/2F+CEtWSGQf7QaCPdsVZ/TpREpwaKNFcf02oA==", + "version": "git+https://github.com/probablykasper/electron-panel-window.git#9d23ea6baa94a82506642461726661c8e5b641d1", + "from": "git+https://github.com/probablykasper/electron-panel-window.git", + "dev": true, "requires": { - "bindings": "^1.3.1", - "nan": "^2.11.1" + "bindings": "^1.5.0" } }, "electron-publish": { @@ -1182,7 +1182,8 @@ "file-uri-to-path": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/file-uri-to-path/-/file-uri-to-path-1.0.0.tgz", - "integrity": "sha512-0Zt+s3L7Vf1biwWZ29aARiVYLx7iMGnEUl9x33fbB/j3jR81u/O2LbqK+Bm1CDSNDKVtJ/YjwY7TUd5SkeLQLw==" + "integrity": "sha512-0Zt+s3L7Vf1biwWZ29aARiVYLx7iMGnEUl9x33fbB/j3jR81u/O2LbqK+Bm1CDSNDKVtJ/YjwY7TUd5SkeLQLw==", + "dev": true }, "find-up": { "version": "1.1.2", @@ -1926,11 +1927,6 @@ "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", "dev": true }, - "nan": { - "version": "2.14.0", - "resolved": "https://registry.npmjs.org/nan/-/nan-2.14.0.tgz", - "integrity": "sha512-INOFj37C7k3AfaNTtX8RhsTw7qRy7eLET14cROi9+5HAVbbHuIWUHEauBv5qT4Av2tWasiTY1Jw6puUNqRJXQg==" - }, "nice-try": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/nice-try/-/nice-try-1.0.5.tgz", diff --git a/package.json b/package.json index 9ab86a8..d09ea15 100644 --- a/package.json +++ b/package.json @@ -9,11 +9,10 @@ "devDependencies": { "electron": "^4.2.5", "electron-builder": "^20.44.4", + "electron-panel-window": "git+https://github.com/probablykasper/electron-panel-window.git", "electron-rebuild": "^1.8.5" }, - "dependencies": { - "electron-panel-window": "^2.0.0-1" - }, + "dependencies": {}, "name": "arcu", "author": "kasper.space", "version": "1.0.0", diff --git a/src/bar/index.html b/src/bar/index.html index b2da158..6c88580 100644 --- a/src/bar/index.html +++ b/src/bar/index.html @@ -11,13 +11,18 @@
woo
- +