21

For some reason, I cannot launch .desktop files. When I double-click the file, it opens the Text Editor. The desktop file has "Allow executing file as program" turned on (-rwx). In the tab "Open with", the Text Editor is the default application. Clicking reset in that tab changes it to the Text Editor, so it basically does nothing.

Any way to solve this?

pomsky
  • 68,507
Liga
  • 531

1 Answers1

20

Basically, I found that the Files/Nautilus application does not allow executing .desktop files anymore. Instead there are 2 options we can do.

  1. Enable 'Desktop icons' using GNOME Tweaks and create the .desktop file inside the Desktop folder. Then it will appear on the desktop (without its icon). Then right click on the desktop icon and choose "Allow launching" and the icon will appear and it will be executable.

  2. Add the .desktop file inside the ~/.local/share/applications and then it will appear in the App launcher, so you can add it to the Dock (add to favorites) and copy to the Desktop folder to add to Desktop.

pomsky
  • 68,507
Liga
  • 531
  • 4
    Is there a CLI way for "Allow Launching"? – Oliver R. Mar 19 '20 at 19:56
  • 3
    "Allow launching" is not an option on 20.04. – Chad Wright Aug 27 '20 at 15:35
  • Sometimes it requires a logout and login for the desktop files in the user's application folder to appear in the app launcher or for the Allow launching option to appear in the desktop icon's context menu. I'm using Ubuntu 20.10 Beta with Gnome 3.38, not sure if it's some bug or something else. However, your answer worked for me, upvoted! – ManSamVampire Oct 05 '20 at 15:28
  • 1
    Man, they've really hobbled Nautilus... – shmim Nov 23 '20 at 05:09
  • For those interested a CLI way of solving it has been found: https://askubuntu.com/questions/1314919/creating-a-program-shortcut-on-the-desktop-entirely-from-the-terminal-in-ubuntu ...hope it helps you like it did for me. – miyalys Mar 27 '21 at 17:55