diff options
Diffstat (limited to 'src/index.js')
-rw-r--r-- | src/index.js | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/index.js b/src/index.js index 87f45e7fc..d947d96ca 100644 --- a/src/index.js +++ b/src/index.js | |||
@@ -1,6 +1,6 @@ | |||
1 | /* eslint-disable import/first */ | 1 | /* eslint-disable import/first */ |
2 | 2 | ||
3 | import { app, BrowserWindow, ipcMain, session, dialog } from 'electron'; | 3 | import { app, BrowserWindow, globalShortcut, ipcMain, session, dialog } from 'electron'; |
4 | 4 | ||
5 | import { emptyDirSync, ensureFileSync } from 'fs-extra'; | 5 | import { emptyDirSync, ensureFileSync } from 'fs-extra'; |
6 | import { join } from 'path'; | 6 | import { join } from 'path'; |
@@ -17,6 +17,7 @@ import { | |||
17 | isMac, | 17 | isMac, |
18 | isWindows, | 18 | isWindows, |
19 | isLinux, | 19 | isLinux, |
20 | altKey, | ||
20 | } from './environment'; | 21 | } from './environment'; |
21 | import { | 22 | import { |
22 | isDevMode, | 23 | isDevMode, |
@@ -360,6 +361,13 @@ const createWindow = () => { | |||
360 | } else { | 361 | } else { |
361 | mainWindow.show(); | 362 | mainWindow.show(); |
362 | } | 363 | } |
364 | |||
365 | app.whenReady().then(() => { | ||
366 | // Toggle the window on 'Alt+X' | ||
367 | globalShortcut.register(`${altKey()}+X`, () => { | ||
368 | trayIcon.trayMenuTemplate[0].click(); | ||
369 | }); | ||
370 | }); | ||
363 | }; | 371 | }; |
364 | 372 | ||
365 | // Allow passing command line parameters/switches to electron | 373 | // Allow passing command line parameters/switches to electron |