*.desktop files opening in Kate

I've downloaded and am playing with the new Neon release of KDE. When I activate an item from the Kickoff menu, though, it opens up a *.desktop file in the Kate text editor instead of launching the item. What's the issue?


Solution 1:

Background

I encountered this bug with a clean installation of 32-bit Kubuntu 16.10. After allowing updates to the system:

  1. with Dolphin I browsed to remote: (Network)
  2. I opened Add Network Folder
  3. I expected a launch of knetattach (Network Folder Wizard – KDE Network Wizard)
  4. instead, a .desktop file was opened by Kate.

I installed Thunar 1.6.11, browsed /usr/share/applications/ and found files, with representative names such as KNetAttach, behaving as expected.

Browsing the same directory with Dolphin, I found org.kde.knetattach.desktop and other .desktop files misbehaving; Dolphin failed to execute the required files.

Unix & Linux Stack Exchange

There's the accepted answer to KUbuntu 10.04 / Dolphin File Manager: Is there a way to make .desktop files display the filename the same as the NAME= in the metadata? – relevant to one of the symptoms that were observed in my case, but not a solution to the execution problem.

Super User

There's the accepted answer to KDE launcher opens .desktop files in Kate but what's suggested there did not work around the execution problem in my case.

The solution in my case

The reply to .desktop files are opened with text editor • KDE Community Forums refers to a 2015 topic:

  • How do I unset default to open .desktop in a text editor?

– I took a hint from a 2016 reply from mfrandsen.

nano ~/.config/kiorc

The file comprised two lines,

[Executable scripts]
behaviourOnLaunch=open

I edited the second line to read:

behaviourOnLaunch=execute

– then saved the file.

Immediately after the save, Dolphin behaved as expected.