From c11cf41f305018af76c4deea1c8695cdc4cc6610 Mon Sep 17 00:00:00 2001 From: zadam Date: Sun, 16 Oct 2022 20:52:10 +0200 Subject: [PATCH] don't create app icon for flatpak/debian linux builds, fixes #3201 --- src/services/app_icon.js | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/services/app_icon.js b/src/services/app_icon.js index 07d031418..a749c53fa 100644 --- a/src/services/app_icon.js +++ b/src/services/app_icon.js @@ -28,11 +28,17 @@ function installLocalAppIcon() { return; } + if (!fs.existsSync(path.resolve(ELECTRON_APP_ROOT_DIR, "trilium-portable.sh"))) { + // simple heuristic to detect ".tar.xz" linux build (i.e. not flatpak, not debian) + // only in such case it's necessary to create an icon + return; + } + const desktopDir = path.resolve(os.homedir(), '.local/share/applications'); fs.stat(desktopDir, function (err, stats) { if (err) { - // Directory doesn't exist so we won't attempt to create the .desktop file + // Directory doesn't exist, so we won't attempt to create the .desktop file return; } @@ -64,4 +70,4 @@ function getExePath() { module.exports = { installLocalAppIcon -}; \ No newline at end of file +};