How to add a desktop shortcut for an application downloaded from the internet?

Hello,
I am trying to add a desktop shortcut for my downloaded application. (postman) in Gnome 40.4.0 with Fedora 34. I do not get that option in the context menu.

I tried creating a .desktop file with the following content, but it does not work.

#!/usr/bin/env xdg-open

[Desktop Entry]

# The type as listed above

Type=Application

# The version of the desktop entry specification to which this file complies

Version=1.0

# The name of the application

Name=postman

# A comment which can/will be used as a tooltip

Comment=Postman

# The path to the folder in which the executable is run

#Path=/home/XXX/Downloads/Postman-linux-x64-8.10.0/Postman/app

# The executable of the application, possibly with arguments.

Exec=/home/XXX/Downloads/Postman-linux-x64-8.10.0/Postman/app/postman

# The name of the icon that will be used to display this entry

Icon=postman

# Describes whether this application needs to be run in a terminal or not

Terminal=false

# Describes the categories in which this entry should be shown

Categories=Programming

Can someone please help?
Thanks!

How are you testing it?

By running ./file.desktop in the console after marking it as a executable.
It opens the file in my text editor and does not execute.

I have a feeling that the first line of the .desktop file is incorrect and need to be changed.

Here is one of mine:

[Desktop Entry]
Comment=
Exec=/home/dalto/.local/share/minecraft-launcher/minecraft-launcher
Icon=/home/dalto/.local/share/minecraft-launcher/minecraft-1-logo-pack/minecraft-1-logo-png-transparent.png
Name=Minecraft Launcher
NoDisplay=false
Path[$e]=
StartupNotify=true
Terminal=0
TerminalOptions=
Type=Application

All of mine start with [Desktop Entry] as the first line.

Also, it shouldn’t need to be executable. I usually just put them in ~/.local/share/applications/ and then they will show up in the menus.

2 Likes

Thanks!
That worked.

3 Likes

I seem to recall the *.desktop file needs to be u+x.

Maybe that has changed recently?

As far as I know that has never been the case.

Take a look at ls -l /usr/share/applications

1 Like