Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(Bug report) Trilium overwrites the local user desktop entry on start #4502

Closed
hollowshiroyuki opened this issue Dec 6, 2023 · 1 comment

Comments

@hollowshiroyuki
Copy link

Trilium Version

0.62.3

What operating system are you using?

Other Linux

What is your setup?

Local + server sync

Operating System Version

Archlinux (Linux 6.6.3-zen1-1-zen #1 ZEN SMP PREEMPT_DYNAMIC Wed, 29 Nov 2023 00:40:39 +0000 x86_64 GNU/Linux)

Description

Trilium overwrites the .local/applications/trilium-desktop.local file each time it's started.

const desktopFilePath = path.resolve(desktopDir, "trilium-notes.desktop");
fs.writeFile(desktopFilePath, getDesktopFileContent(), function (err) {

As Trilium doesn't automatically detect my Wayland environment, I'm forcing electron to use it with the --ozone-platform-hint=auto argument in the local desktop file.

I don't think overwriting this file is a correct behavior. The "default" desktop entry should be installed by the package manager inside /usr/share/applications and will be modified by updates since users should not modify this file themselves.

I also can't create another desktop entry with a different name, because Trilium will also create it's own entry anyway. Resulting in the app showing multiple times in launchers.

I understand Trilium is also distributed as a standalone executable so updating the desktop file may be required.

We could then imagine some solutions :

  • A command line argument --overwrite-user-desktop-entry in the template file that users can remove to customize their own entry.
  • A comment in the desktop file # Remove this comment to prevent Trilium from overwriting this file , and detect it before trying to overwrite.
  • Only create the user desktop entry if a system desktop entry is not found.

As a workaround for now, I removed the write permission on the file. Symlinking trilium-notes.desktop to /dev/null and creating another desktop entry with a different name can work but launchers might display the system entry file if the user one is "broken".

Error logs

No error log to provide.

@zadam
Copy link
Owner

zadam commented Dec 6, 2023

Hello, you can disable it in the config.ini:

[General]
# Disable automatically generating desktop icon
noDesktopIcon=true

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants