diff --git a/README.md b/README.md index 2efbcaf32..2f83991dd 100644 --- a/README.md +++ b/README.md @@ -21,6 +21,26 @@ - Works with limitations: - File Viewer — only images and videos +## 👥 Multi-account + +Full multi-account currently [is not currently supported](https://github.com/nextcloud/talk-desktop/issues/7). + +However, using portable `zip` distribution, you can have several Nextcloud Talk instances run simultaneously. Just rename the executable from default `Nextcloud Talk` to a custom name. For example: + +``` +/path/to/apps/ +├── home-apps/ +│ └── Nextcloud Talk/ +│ ├── ... +│ ├── Nextcloud Talk (Home).exe +│ └── ... +└── work-apps/ + └── Nextcloud Talk/ + ├── ... + ├── Nextcloud Talk (Work).exe + └── ... +``` + ## 🧑‍💻 Development Setup ### Initial setup diff --git a/src/main.js b/src/main.js index cd63ae90e..58b41e640 100644 --- a/src/main.js +++ b/src/main.js @@ -42,12 +42,12 @@ const ARGUMENTS = { } /** - * Separate production and development instances, including application and user data + * On production use executable name as application name to allow several independent application instances. + * On development use "Nextcloud Talk (dev)" instead of the default "electron". */ -if (process.env.NODE_ENV === 'development') { - app.setName('Nextcloud Talk (dev)') - app.setPath('userData', path.join(app.getPath('appData'), 'Nextcloud Talk (dev)')) -} +const APP_NAME = process.env.NODE_ENV !== 'development' ? path.parse(app.getPath('exe')).name : 'Nextcloud Talk (dev)' +app.setName(APP_NAME) +app.setPath('userData', path.join(app.getPath('appData'), app.getName())) app.setAppUserModelId(app.getName()) /** @@ -71,6 +71,7 @@ if (process.env.NODE_ENV === 'production') { ipcMain.on('app:quit', () => app.quit()) ipcMain.handle('app:getOs', () => getOs()) +ipcMain.handle('app:getAppName', () => app.getName()) ipcMain.handle('app:getSystemL10n', () => ({ locale: app.getLocale().replace('-', '_'), language: app.getPreferredSystemLanguages()[0].replace('-', '_'), diff --git a/src/preload.js b/src/preload.js index 451803a3f..ed94358b8 100644 --- a/src/preload.js +++ b/src/preload.js @@ -48,6 +48,12 @@ const TALK_DESKTOP = { * @type {typeof packageInfo} packageInfo */ packageInfo, + /** + * Get app name + * + * @return {Promise} + */ + getAppName: () => ipcRenderer.invoke('app:getAppName'), /** * Quit the application */ diff --git a/src/talk/renderer/talk.main.js b/src/talk/renderer/talk.main.js index d4de0715b..a8e04a94c 100644 --- a/src/talk/renderer/talk.main.js +++ b/src/talk/renderer/talk.main.js @@ -32,6 +32,8 @@ if (!window.location.hash) { window.location.hash = '#/apps/spreed' } +document.title = await window.TALK_DESKTOP.getAppName() + await setupWebPage() const { router } = await init()