Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have my custom script in Ruby with read permission, which starts with:

#!/usr/bin/env ruby

I can run that script from the terminal by typing that path. I added a file with .desktop extention to /usr/share/applications with content

[Desktop Entry]

and permission 777. When I open the Ubuntu file/application searcher at the top-left corner, I find my script by typing in the name. But when I click on it, it does not run. What am I doing wrong?

share|improve this question
You may believe the content is appropriate but there is no way we can know unless you show us. You should also mention the permissions of the .desktop file. – terdon Apr 9 '14 at 14:49
I added that information, but I don't think the problem is with that part because I had the same problem with adding a launcher to the menu bar with an older Ubuntu, which I asked on this site about , about an year ago:…, and it has not yet been solved. – sawa Apr 9 '14 at 14:55

I do not know what exactly is "content that I believe is appropriate". However, if you can run the script through terminal all you have to do is create a script with:

cd /path/to/folder

Make the script executable. Then in your .desktop file, launch the script instead of your command directly.


#!/usr/bin/env xdg-open

[Desktop Entry]
Exec=path/to/icon/bash script
Name=Script name
Comment=A description here
share|improve this answer
The script cannot be Ruby but has to be bash? – sawa Apr 9 '14 at 14:57

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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