KDE launcher opens .desktop files in kate

Posted on

Problem :

Opening programs via the ‘Application Launcher’ menu, then selecting the program works.

Using the launcher generated on the panel, eg by right-clicking on an open program, then selecting ‘Show A Launcher When Not Running’ places a .desktop file which is opened with kate.

xdg-mime query filetype /opt/kde/share/applications/org.kde.dolphin.desktop

returns text/plain, as does the same command for

/opt/kde/share/applications/org.kde.rekonq.desktop etc.

xdg-mime query default text/plain then returns org.kde.kate.desktop, explaining why the files are being opened by kate.

Presumably the problem here is that the mimetype of the *.desktop files should be something other than text/plain. What should it be? Is there a simple way to check/find out/change these?

Note: KDE-5, Plasma-5, (C)LFS, source installs, etc. No package manager.

Solution :

Running update-mime-database repeatedly, with /opt/kde/share/mime, /opt/gnome/share/mime, /usr/share/mime fixed this problem.

As was mentioned by Firelord in a comment, the type that the *.desktop files were assigned following this operation was application/x-desktop. I suspect it is likely that manually setting this as their mime-type would be sufficient to solve the problem.

For those who later see this post, in case it is helpful:

In related (to the solution, but not to the original question) news, this also takes me a step closer to making rekonq download files.

Leave a Reply

Your email address will not be published. Required fields are marked *