From cab2a287cf23fb043ff055d2dd237852d47ad1d1 Mon Sep 17 00:00:00 2001 From: silentrald Date: Sun, 17 Aug 2025 14:42:37 +0800 Subject: [PATCH] [feat-906] changed linux home directory to XDG_DATA_HOME --- src/main/main.ts | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/src/main/main.ts b/src/main/main.ts index 40c9e9d3..26e248fa 100644 --- a/src/main/main.ts +++ b/src/main/main.ts @@ -100,6 +100,16 @@ const findAssociatedFileInArgs = (args: string[]): string => { const gotTheLock = app.requestSingleInstanceLock(); +const init = () => { + initServicesMustBeInitialized(); + + if (process.platform === "linux") { + // Properly set up the home path for linux + const homePath = process.env.XDG_DATA_HOME || path.join(process.env.HOME, ".local", "share"); + app.setPath("home", homePath); + } +} + if (!gotTheLock) { app.quit(); } else { @@ -123,8 +133,7 @@ if (!gotTheLock) { app.whenReady().then(() => { app.setAppUserModelId(APP_NAME); - - initServicesMustBeInitialized(); + init(); const deepLink = findDeepLinkInArgs(process.argv); const associatedFile = findAssociatedFileInArgs(process.argv);