Auto-start for Linux
This commit is contained in:
29
electron.js
29
electron.js
@@ -48,10 +48,14 @@ function createWindow() {
|
||||
mainWindow = null
|
||||
});
|
||||
|
||||
if (os.platform() === 'win32') {
|
||||
if ((os.platform() === 'win32') || (os.platform() === 'linux')) {
|
||||
const appPath = (os.platform() === 'win32') ?
|
||||
path.resolve(path.join(app.getAppPath(), '..\\..\\repertory-ui.exe')) :
|
||||
process.env.APPIMAGE;
|
||||
|
||||
const autoLauncher = new AutoLaunch({
|
||||
name: 'Repertory UI',
|
||||
path: path.resolve(path.join(app.getAppPath(), '..\\..\\repertory-ui.exe')),
|
||||
path: appPath,
|
||||
});
|
||||
|
||||
const image = nativeImage.createFromPath(path.join(__dirname, '/build/logo.png'));
|
||||
@@ -89,17 +93,18 @@ function createWindow() {
|
||||
]);
|
||||
|
||||
mainContextWindow.items[0].checked = true;
|
||||
autoLauncher.isEnabled()
|
||||
.then((enabled) => {
|
||||
mainContextWindow.items[1].checked = enabled;
|
||||
autoLauncher
|
||||
.isEnabled()
|
||||
.then((enabled) => {
|
||||
mainContextWindow.items[1].checked = enabled;
|
||||
|
||||
mainWindowTray = new Tray(image);
|
||||
mainWindowTray.setToolTip('Repertory UI');
|
||||
mainWindowTray.setContextMenu(mainContextWindow)
|
||||
})
|
||||
.catch(() => {
|
||||
app.quit();
|
||||
});
|
||||
mainWindowTray = new Tray(image);
|
||||
mainWindowTray.setToolTip('Repertory UI');
|
||||
mainWindowTray.setContextMenu(mainContextWindow)
|
||||
})
|
||||
.catch(() => {
|
||||
app.quit();
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user