KDE breaks custom .desktop files after running them once

I made a custom .desktop file for an AppImage file.
When I run it, it launches fine, but KDE automatically edits it to add NoDisplay=true, hiding it from the menus. It also deletes the Icon= line.
This is incredibly stupid and pointless. How do I stop this from happening?

Before:

[Desktop Entry]
Name=StabilityMatrix
Exec=/home/user/AI/StabilityMatrix.AppImage %u
Icon=/home/user/.local/share/applications/stabilitymatrix.png
Type=Application
NoDisplay=false
Categories=Utility

After:

[Desktop Entry]
Name=StabilityMatrix
Exec=/home/user/AI/StabilityMatrix.AppImage %u
Type=Application
NoDisplay=true
Categories=Utility
X-Desktop-File-Install-Version=0.27
MimeType=x-scheme-handler/stabilitymatrix;x-scheme-handler/stabilitymatrix

I would certainly agree if that was my experience with doing it. However each and everyone I have created remain the same as the day they were created. Despite being used numerous times to launch the .AppImage they do. What is this X-Desktop-File-Install-Version you or your distribution seems to be using that is messing it up? Better yet how do you install them, what is the distribution? I simply place them into the ~/.local/share/applications/ directory once created and they show up in the menu to be used, never changing after put there unless I edit them.

1 Like

What is this X-Desktop-File-Install-Version

No clue. I am running Fedora 41.

Better yet how do you install them

I am putting it in ~/.local/share/applications/.

Very strange - I’m also running Fedora KDE 41, and simply manually creating a .desktop file for an AppImage, then moving it to ~/.local/share/applications/, doesn’t create either of those lines.

Do you have any other management tools, helpers, or anything else specific to AppImages installed, perhaps?

maybe stupid idea but change “the rights” for .desktop file?
Remove possibility to “change/edit”?

I tried making a shell script to launch the AppImage and then a .desktop to run the script, exact same thing happens.

Not that I know of.

I decided to try this, but after having it disappear once it’s not showing up in the ‘start’ menu or KRunner after replacing with the working file. Running it from Dolphin works, but it still gets overwritten with the broken one after I chmod 400 it.

I added a line to the script to replace the broken file with the working one upon exit which actually worked.

However, KDE ignores this and after running it once it is still hidden from the menus even if I add NoDisplay=false to the working .desktop file.

It’s the appimg itself. It creates a second desktop file on its own in ~/.local/share/applications. No icon…nothing. The one you make yourself should show in the menu though.


2 Likes

How strange! So I just happened to choose the same filename as the one the appimage created and it was overwritten.
I tried renaming mine to a different name and it seems to work. Thanks!

I looked on their github and apparently someone else noticed that the generated .desktop had nodisplay as true and asked for an option to disable that, but it has no responses a few months later.