diff --git a/electron/configs/index.js b/electron/configs/index.js index bc0e946..9d1ec02 100644 --- a/electron/configs/index.js +++ b/electron/configs/index.js @@ -24,14 +24,6 @@ export const trayPath export const logPath = process.env.LOG_PATH export function getLogoPath() { - let icon = logoPath - - if (process.platform === 'win32') { - icon = icoLogoPath - } - else if (process.platform === 'darwin') { - icon = icnsLogoPath - } - - return logoPath + const icon = logoPath + return icon } diff --git a/electron/exposes/scrcpy/index.js b/electron/exposes/scrcpy/index.js index 5d11ffa..18aea9d 100644 --- a/electron/exposes/scrcpy/index.js +++ b/electron/exposes/scrcpy/index.js @@ -9,7 +9,7 @@ let adbkit const exec = util.promisify(_exec) -async function shell(command, { stdout, stderr } = {}) { +async function shell(command, { stdout, stderr, ...options } = {}) { const spawnPath = appStore.get('common.scrcpyPath') || scrcpyPath const ADB = appStore.get('common.adbPath') || adbPath const args = command.split(' ') @@ -18,6 +18,7 @@ async function shell(command, { stdout, stderr } = {}) { env: { ...process.env, ADB }, shell: true, encoding: 'utf8', + ...options, }) scrcpyProcess.stdout.on('data', (data) => { @@ -168,13 +169,17 @@ async function mirrorGroup(serial, { openNum = 1, ...options } = {}) { return Promise.allSettled(results) } -async function control(serial, { command, exec = true, ...options } = {}) { - const currentShell = exec ? execShell : shell - +async function helper( + serial, + command = '', + { hiddenWindow = false, ...options } = {}, +) { const stringCommand = commandHelper.stringify(command) - return currentShell( - `--serial="${serial}" --no-video --no-audio ${stringCommand}`, + return execShell( + `--serial="${serial}" --window-title="EscrcpyHelper" ${ + hiddenWindow ? '--window-x=-300 --window-y=-300' : '' + } --no-video --no-audio --mouse=disabled ${stringCommand}`, options, ) } @@ -189,6 +194,6 @@ export default (options = {}) => { mirror, record, mirrorGroup, - control, + helper, } } diff --git a/electron/ipc/shortcuts/index.js b/electron/ipc/shortcuts/index.js index e0c4d90..15d20c9 100644 --- a/electron/ipc/shortcuts/index.js +++ b/electron/ipc/shortcuts/index.js @@ -1,12 +1,5 @@ // import { globalShortcut } from 'electron' export default (mainWindow) => { - // mainWindow.on('focus', () => { - // globalShortcut.register('CommandOrControl+F', (event) => { - // mainWindow.webContents.send('focus-on-search') - // }) - // }) - // mainWindow.on('blur', () => { - // globalShortcut.unregister('CommandOrControl+F') - // }) + // globalShortcut.register('Alt+O', () => {}) } diff --git a/src/components/Device/components/ControlBar/index.vue b/src/components/Device/components/ControlBar/index.vue index 65dc233..8eeed6a 100644 --- a/src/components/Device/components/ControlBar/index.vue +++ b/src/components/Device/components/ControlBar/index.vue @@ -16,7 +16,7 @@