Auto-start for Linux
This commit is contained in:
29
electron.js
29
electron.js
@@ -48,10 +48,14 @@ function createWindow() {
|
|||||||
mainWindow = null
|
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({
|
const autoLauncher = new AutoLaunch({
|
||||||
name: 'Repertory UI',
|
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'));
|
const image = nativeImage.createFromPath(path.join(__dirname, '/build/logo.png'));
|
||||||
@@ -89,17 +93,18 @@ function createWindow() {
|
|||||||
]);
|
]);
|
||||||
|
|
||||||
mainContextWindow.items[0].checked = true;
|
mainContextWindow.items[0].checked = true;
|
||||||
autoLauncher.isEnabled()
|
autoLauncher
|
||||||
.then((enabled) => {
|
.isEnabled()
|
||||||
mainContextWindow.items[1].checked = enabled;
|
.then((enabled) => {
|
||||||
|
mainContextWindow.items[1].checked = enabled;
|
||||||
|
|
||||||
mainWindowTray = new Tray(image);
|
mainWindowTray = new Tray(image);
|
||||||
mainWindowTray.setToolTip('Repertory UI');
|
mainWindowTray.setToolTip('Repertory UI');
|
||||||
mainWindowTray.setContextMenu(mainContextWindow)
|
mainWindowTray.setContextMenu(mainContextWindow)
|
||||||
})
|
})
|
||||||
.catch(() => {
|
.catch(() => {
|
||||||
app.quit();
|
app.quit();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user