Normally, all my .desktop entries are always in /usr/share/applications.
I noticed that I had a duplicate thunderbird entry in ‘default applications’ section of KDE settings, so I did some digging and found that somehow I have some new .desktop entries in /.local/share/applications.
Is it safe to delete these? Why would these end up in here anyway when they’re also in the /user/share/applications?
I feel like I took a peak in this folder a few weeks ago and it was empty.
/usr/share/applications is the default location for .desktop entries.
~/.local/share/applications is the user specific location for .desktop entries it allows the user to override the .desktop entry, customize it essentially. Normally it’s used by application launchers which allow you to edit default launch options and such for an application.
But you can also just copy paste a file from /usr/share/applications to ~/.local/share/applications and edit it for that same effect, I do this quite a lot actually.
These are obviously created by an application, either the relevant one (Discord created a custom discord entry), or from the DE (Plasma settings, or other plasma component), from a user session (user privileges).
If there is no documentation from the above programs about it, you should find some signs/clues reading those files’ contents.
Those are menu entries for any XDG-compatible application menu. They do not necessarily override other existing menu entries, rather add new similar ones for another existing one. In order to override, the file name must be exactly the same, which, as it seems from the screenshot, the file name includes a hash/string in the file’s basename (without the extension).
Possible use cases are
a shortcut for a program launcher
a menu entry with an altered command (Exec= key).
Also, it is possible they include custom Show/Hide instructions, as the creator program is designed to do, using keys like
Display=false # hidden in menus
OnlyShowIn=KDE; # for example
NotShowIn=Gnome; # or other
or with extra program-specific keys, like for example