mirror of
https://github.com/fluxerapp/fluxer
synced 2026-10-17 21:15:32 +09:00
21 lines
579 B
TypeScript
21 lines
579 B
TypeScript
// SPDX-License-Identifier: AGPL-3.0-or-later
|
|
|
|
import {getDesktopWindowBehaviorSettings} from '@electron/common/DesktopConfig';
|
|
import {app} from 'electron';
|
|
|
|
export const AUTOSTART_LAUNCH_ARG = '--autostart';
|
|
|
|
function isAutostartLaunch(): boolean {
|
|
if (process.argv.includes(AUTOSTART_LAUNCH_ARG)) {
|
|
return true;
|
|
}
|
|
if (process.platform === 'darwin') {
|
|
return Boolean(app.getLoginItemSettings().wasOpenedAtLogin);
|
|
}
|
|
return false;
|
|
}
|
|
|
|
export function isStartMinimizedLaunch(): boolean {
|
|
return isAutostartLaunch() && getDesktopWindowBehaviorSettings().startMinimized;
|
|
}
|