I created a
.desktop file to launch an application and saved it to my
~/Desktop folder. It was working until I added another
.desktop file. The original
.desktop file no longer shows it's configured icon and when I click it just opens in a text editor. Same behavior with the new file. The 'Allow Launching' option is not available when I right-click on the file. In the file properties it has my text editor listed as the default application. Is that correct? Is there another reason why this might not be working?
.desktop files work fine if I add them to
Ubuntu 20.04.1 LTS
Edit: The solution by @Matigo worked except instead of dragging the
.desktop file directly onto the desktop I had to open my
~/Desktop folder in Nautilus and drag it there. Then I was able to right click and select Allow Launching.
Edit: After further experimenting I found that I could add a new .desktop file manually without using
desktop-file-install. If I created a new .desktop file and saved it directly to
~/Desktop then it would work fine. Or if I created the .desktop file in my home dir and dragged it from there it would also work. What doesn't work, and causes all existing shortcuts to stop working, is to drag a .desktop file from a folder in a different partition. I'm not sure why that breaks things but that's what I found. To restore just delete all .desktop files in
~/Desktop and add them again.