What I want to do at all, is that: Create script that has icon on it. So I know only one way - file.desktop file with icon. Settings icon on it was successful, but I have no luck setting EXEC value :/

Can someone explain me a bit how to create executable script with icon on it? create .desktop file and link it to that script? Can someone give me structure of that .desktop file?

You didn't mention what you have tried, so try this:

[Desktop Entry]

Make sure that your script is executable, like this:

sudo chmod +x /path/to/script.sh  

It also won't work with if your script uses the sudo command, or anything else that requires user input.

If you want it to open a terminal window when you run it (if you needed to add input or watch the output) set Terminal to true.

  • up for Terminal :) – ceph3us Jun 27 '16 at 11:46
  • For me Terminal=true solved the issue. – JoeFox Apr 19 '17 at 9:08
  • 1
    BOTH the desktop file and the script must be executable. Otherwise it didn't work for me. – user3804598 Dec 17 '17 at 17:06

Use gnome-desktop-item-edit :

gnome-desktop-item-edit --create-new /path/to/new/launcher

# Usually, one does (create launcher in current directory) :
gnome-desktop-item-edit --create-new .

You'll be graphically prompted for those settings. Here's one of my launcher, which I created with this tool :

#!/usr/bin/env xdg-open

[Desktop Entry]
Comment[en_GB]=Some comment for en_GB
Name=Launcher Name
Comment=Some comment.

The en_GB specific settings are not mandatory. Feel free to fill in with identical values.

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.