Automatically sets the DISPLAY environment variable for linux

This commit is contained in:
Ryan Huang
2024-10-28 13:12:41 -04:00
parent 0566784e45
commit 3a1be639d4

View File

@ -86,7 +86,12 @@ export async function wakeUpService(logger: SimpleLogger): Promise<boolean> {
logger.debug(`Spawning process:`, { path, args, cwd });
const child = spawn(path, args, { cwd, detached: true, stdio: "ignore" });
const env = {
...(process.platform === "linux" ? { DISPLAY: ":0" } : {}),
...process.env,
};
const child = spawn(path, args, { cwd, detached: true, stdio: "ignore", env });
child.unref();
logger.debug(`Process spawned`);