I have just created a .desktop shortcut on my desktop to launch a shell scrip. The script itself works fine, but its shortcut that doesn't display the icon and double-clicking on it just displays its content in gedit:

[Desktop Entry]

It is allowed to execute as a program in its permissions, so that's not an issue:

File permissions

Does anyone have any ideas why this is happening? Any help would be greatly appreciated!

  • Create a folder on your Desktop called TEST, or whatever. If you move the .desktop file into that TEST folder, does it work then?
    – heynnema
    Commented May 8, 2020 at 14:41
  • No, same behaviour inside a folder
    – Alvaro
    Commented May 8, 2020 at 15:05
  • Move your .desktop file into ~/.local/share/applications/, then hit the Super key and type the name of the shortcut, and see if it works then. If not, move the .sh file into your Documents folder, edit the .desktop file, and retry. Make sure the .sh file is executable. (.desktop files, and files on the Desktop, work strangely in 19.xx and higher).
    – heynnema
    Commented May 8, 2020 at 15:12
  • Thanks for the answer, that way the .desktop file can run (still doesn't display the icon though). However, the point was to have a shortcut in the desktop, can't believe this is so difficult
    – Alvaro
    Commented May 8, 2020 at 15:29
  • You've given terminal false, So the script might have executed and completed. Is it throwing any error by the way? Commented Dec 2, 2020 at 17:22

14 Answers 14


Make sure you've allowed launching and, maybe, selected it as Run Software on Open With tab.

enter image description here

Configure your shortcut the next way:

[Desktop Entry]
Name=Firefox Web Browser
Comment=Browse the World Wide Web
GenericName=Web Browser

I've copied firefox's shortcut settings and modified them to allow to launch your script. With this it allows changing its launching configuration. You could remove unneeded options and check if it works without them.

  • 11
    I have tried to set "Run Software" as the default application with the same result and unfortunately I don't have the option "Allow launching" when I do right clic on it...
    – Alvaro
    Commented May 8, 2020 at 14:52
  • I have used your proposal using the firefox config but same behaviour. When I open it from the desktop it just opens the file and if I open it from nautilus (having allowed to run it in preferences/behaviour) it just open the terminal briefly but doesn't run the script.
    – Alvaro
    Commented May 8, 2020 at 15:13
  • I have tried exactly your config but unfortunately I don't have the Allow launching option when I do right click on it... any idea why this could be?
    – Alvaro
    Commented May 8, 2020 at 15:21
  • @Alvaro consider using Gnome desktop instead of Unity. As it seems, Unity does not have this ability. Make a screenshot of your desktop with launcher visible to see what it should be.
    – Gryu
    Commented May 19, 2020 at 10:14
  • Do you know what happens behind the scenes if you click "Allow Launching"? I'm guessing it doesn't just set the executable bit.
    – Flimm
    Commented Nov 24, 2023 at 12:51
  • Move the .desktop file into ~/.local/share/applications/ and make executable if need be.

  • Move the .sh and .png files into ~/Documents and make sure the .sh is executable.

  • Modify your .desktop file for the new locations for the .sh and .png files.

  • Hit the Super key and type the name of your shortcut.

  • You can save your .desktop file as a favorite in the Dock for quick access.


  • 5
    This option has worked for me but the point was to have the shortcut on the desktop which seems to be the real issue
    – Alvaro
    Commented May 8, 2020 at 15:49
  • 3
    @Alvaro As far as I know, .desktop files won't work from the Desktop in 20.04.
    – heynnema
    Commented May 30, 2020 at 16:57

This was hidden in the comments but it is absolutely the only way to make it work on Ubuntu 20.04 LTS after the latest updates:

This still works (going back several Ubuntu versions):

Copy the application launcher in your home directory (~/application.desktop)

At the command line (in a terminal) run sudo desktop-file-install application.desktop.

This checks the syntax of the launcher and (if it has no errors) installs it into /usr/share/applications.

Open nautilus in /usr/share/applications.

Find the icon for the launcher (application.desktop) and drag the icon to some convenient location in the dash. This locks the launcher to the dash.

  • 3
    This is a good first answer but could use some formatting. eg use sudo desktop-file-install application.desktop instead of "sudo desktop-file-install application.desktop". More importantly though a few screen shots would make the answer easier for people to try out on their own machines. Commented Dec 31, 2020 at 22:10
  • 2
    desktop-file-install also validates the .desktop file which is really important to catch potential errors/issues. desktop-file-validate is the dedicated command for validation.
    – Junaid
    Commented Mar 6, 2021 at 21:28
  • Drag&Drop in nautilus fails for me because of permission issues, what works is copying it on command line. Commented Apr 9, 2021 at 11:38
  • This is great but I have a blank icon on my dock... any way to put any kind of icon?
    – BrianBlaze
    Commented Dec 29, 2021 at 18:25
  • @Junaid, Thank you so much for the validation. That helped me big time. Turns out the "Version" key is NOT mandatory and it is NOT referring to the version of the application the shortcut is pointing to. I set it to 1.0, which was valid. See the docs at Open Desktop org: specifications.freedesktop.org/desktop-entry-spec/latest/… Also upvoted you, of course. Commented Oct 8, 2022 at 16:34

I had the same issue and I was struggling for quite while

Issues that I was facing:

  1. Icons were not showing
  2. Double Clicking an a desktop shortcut would open a text editor instead of launching the application

How I solved this problem?

Right click the icon > Properties > Permissions

Set Group access to Read and Write and Others Access to Read-only and check Execute.

Shortcut Icon permission settings

and select Allow Launching

Allow Launching

Now You icon will appear and you can double click to run the program

enter image description here

  • Nicely explained with the images.
    – PhoneixS
    Commented Oct 1, 2020 at 8:53
  • 4
    Setting the access for others to "Read-Only" seems to be the key for the "Allow Launching"-menu option even showing. That's the piece of the puzzle that was missing from the other answers. I would be interested in their reason for hiding the option and making the transition seemingly as convoluted as possible. At any rate: +1
    – Kakturus
    Commented Jan 28, 2021 at 13:11

How I solved it. None of these tips worked for me, yet I had a manually created shortcut to Spyder on my desktop that worked. Like many of you, "Allow Launching" did not appear in the right-click context menus. My problem was in the EXEC= field, and that I used the ~ character rather than the real path.

  • I experienced the same. In any of the field that takes a path, the tilde (~) character could not be replaced with current user's home directory path. And giving an absolute path (without the ~ character) works. Then the xyz.desktop file can be copied to home or any other directory. Right click on it and then "Allow Launching" would appear in the context menu. Click on this option and the launcher works!
    – soupso
    Commented Mar 21, 2023 at 10:41

None of the above worked for me.

This still works (going back several Ubuntu versions):

  1. Copy the application launcher in your home directory (~/application.desktop)
  2. At the command line (in a terminal) run "sudo desktop-file-install application.desktop" (without the quotes). This checks the syntax of the launcher and (if it has no errors) installs it into /usr/share/applications
  3. Open nautilus in /usr/share/applications.
  4. Find the icon for the launcher (application.desktop) and drag the icon to some convenient location in the dash. This locks the launcher to the dash.
  • same here. All answers other than, @Mr_Display_Name is just bogus. In case of Ubuntu 20.04 OS.
    – Mithun B
    Commented Nov 6, 2020 at 12:07
  • Changing the "Exec" command works for me. Using Ubuntu 22.04.
    – Dante
    Commented Jun 23, 2022 at 12:35

First, set the .desktop file as 'trusted':

$ gio set <entry.desktop> metadata::trusted true


$ sudo chmod +x <entry.desktop>

My final solution (after fixing permissions, ownership, typos, etc..) was to make a copy of the launcher from the desktop back on to the desktop. No other changes. The copy (which had identical ownership and permissions) had the "Allow Launching" context menu item; the original did not.

  • Similar experience. Currently I'm able to go to terminal and run cp myprogram.desktop myprogram2.desktop, and then the original one (myprogram.desktop) starts working again, as well as the new one having "Allow Launching". Then it fails again after like 1 day and I can repeat the same process to get it to work again...
    – krubo
    Commented Sep 4, 2021 at 19:32

The Allow Launching was not appearing for me at all. There is subtle but important point made by Kakturus above. I am re-stating it below. The access for others needs to be Read-only, then the Allow Launching will appear!

Setting the access for others to "Read-Only" seems to be the key for the "Allow Launching"-menu option even showing. That's the piece of the puzzle that was missing from the other answers. I would be interested in their reason for hiding the option and making the transition seemingly as convoluted as possible. At any rate: +1 – Kakturus Jan 28 at 13:11


Just type on terminal, at the path where the .desktop is located "chmod -R 755 ."(as . is making reference to the path where you are at the moment of typing), advice, do it on /Desktop to make sure futures icons will get those permissions. Take care


Sorry if this method doesn't work for you. In properties box of the file you must change Others access to Read only to see the Allow launching in the dropdown menu. May it help.


I've the same problem but my starter is created by a bash script that installs an application. The starters is created but is not launchable with Ubuntu 20.04 (it works fine with 18.04). So, is there any command such as "chmod" to include in my script and to apply to the starter file that makes it "launchable"? BTW, on Ubunru 20.04, this problem occurs only with Gnome and not with both Cinnamon and Mate!!! Thank you in advance.

  • As you already know about Cinnamon and MATE, then maybe it is time to switch to one of them?
    – N0rbert
    Commented Mar 7, 2021 at 7:22
  • Sure, but since my script installs an application, I'd like to make it running the same way whatever GUI the user runs (Cinnamon, Mate, Lxde... AND Gnome 3) on its system. So, I'm looking for the command that the Gnome 3 GUI uses to make a starter launchable when you use the GUI menu option as described below by Gyru and Ashish. I bet it's not a secret but I didn't find any documentation on this subject yet.
    – Fnux
    Commented Mar 7, 2021 at 22:28

Had the same issue when after installing JetBrains Toolbox and IDEs on Ubuntu 23.10.

For me, the error was executing the toolbox install script using sudo which is not recommended. As a result, the application and .desktop files were installed in /root/.local/share instead of in ~/.local/share and the programs would not show in the application launcher.

Fixed the issue by deleting /root/.local/share/JetBrains and the false /root/.local/share/applications/*.desktop files and install the Toolbox and IDEs again without using sudo


Not exactly this case, but I just creted and solved this problem for myself.

I stoppped seeing this "Allow Launching" function after I did this stupid thing:

sudo chmod -R 777 ~

It also crashed a few more things in my system, for example, Steam (but just reinstalation helped).

When I changed the permissions of the ~/Desktop to 744, the "Allow Launching" function reappeared.

So this may be not relevant for directly this case, but may give a clue for the troubleshooting for whoever faces this issue in the future.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .