From 2bd9fb40fedd2c65c6edb0f7f5f4592b3dca83bb Mon Sep 17 00:00:00 2001 From: Yuriy Poltorak Date: Wed, 3 Apr 2024 14:15:34 +0300 Subject: [PATCH 1/2] Add "Hidden on startup" setting --- src/main/index.js | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/main/index.js b/src/main/index.js index e79db94..6f6de97 100644 --- a/src/main/index.js +++ b/src/main/index.js @@ -6,6 +6,7 @@ let fs = require('fs') let gShortcut; let isRemoveLineBreaks = false; +let isHiddenOnStartup = false; const Store = require('electron-store'); const store = new Store(); @@ -36,6 +37,7 @@ app.setAboutPanelOptions({ app.on('ready', function() { let Menu = require('electron').Menu; isRemoveLineBreaks = store.get('remove_line_breaks'); + isHiddenOnStartup = store.get('hidden_on_startup'); let templateArr = [{ label: "Settings", submenu: [{ @@ -63,6 +65,14 @@ app.on('ready', function() { store.set('remove_line_breaks', isRemoveLineBreaks); win.webContents.send('translateClipboard', item.checked); } + }, { + label: "Hidden on startup", + type: "checkbox", + checked: isHiddenOnStartup, + click: (item) => { + isHiddenOnStartup = item.checked; + store.set('hidden_on_startup', isHiddenOnStartup); + } }, { label: "Quit", role: 'quit' @@ -117,7 +127,8 @@ app.on('ready', function() { height: 600, webPreferences: { preload: path.join(__static, 'preload.js') - } + }, + show: !isHiddenOnStartup }); win.loadURL("https://www.deepl.com/translator", { From d7a425b23e6db109ce037443799fe787a3deecbc Mon Sep 17 00:00:00 2001 From: Yuriy Poltorak Date: Wed, 3 Apr 2024 14:16:25 +0300 Subject: [PATCH 2/2] Add example "build in docker" Add "run on linux" solution --- README.org | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/README.org b/README.org index 648c1f6..7a63a3e 100644 --- a/README.org +++ b/README.org @@ -14,7 +14,7 @@ Open deepl-linux-electron, select text in any application, press Ctrl+c to copy selected content into clipboard, then use shortcut *Control+Alt+D* to translate ** set shortcut - You can change this shortcut on the program menu: Settings -> Shortcut + You can change this shortcut on the program menu: Settings -> Shortcut ** user-defined css Support user-defined css, just put your css code into @@ -53,5 +53,20 @@ yarn dev # for build - yarn dist:dir # generated file : dist/linux-unpacked/deepl-linux-electron + yarn dist:dir # generated file : dist/linux-unpacked/deepl-linux-electron #+END_SRC + +** build in docker + #+BEGIN_SRC sh + # run docker in repo dir + docker run -it --rm --name deepl-linux -v $(pwd):/app -w /app --entrypoint /bin/bash node:18 + + # build + yarn install + yarn dist + #+END_SRC + +** run on linux + Deepl may not start with the error `FATAL:gpu_data_manager_impl_private.cc(445)] GPU process isn't usable. Goodbye.` + + If you encounter this, try running `deepl --in-process-gpu`.