Tell me more ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I have this run.sh file, and I've create a symbolic link into my desktop.

When I double-click on it the file the following dialog appearsr

And I have to click on "run" each time. How can I create a link that runs by default?

share|improve this question

3 Answers

up vote 15 down vote accepted

Instead of linking directly to the .sh file create an application launcher as follows:

  • Right click on your desktop
  • Choose "Create Launcher..."
  • Change "Application" to "Application in Terminal" in the drop down box.
  • Give it a name like "Idea"
  • Enter the command like this /path/to/script/idea.sh
  • Add a comment if you like, it will show up when you mouse hover over it if you move the launcher to a menu bar.

Then when you click the launcher a terminal window will open and the command will run in there.

If you don't want to open a terminal to see any output, just use "Application" instead of "Application in Terminal".

share|improve this answer
I wish I could add a non-svg image to the icon created. The rest worked perfectly Thanks. – OscarRyz Aug 18 '10 at 0:16
Mhh.. strange, once created, I could associate the png icon Now it looks like this: yfrog.com/5gscreenshot20100817at719p Nice! – OscarRyz Aug 18 '10 at 0:21
This works. However, when I remove icon from my desktop, it disappears also from launcher. How can I make it stay in launcher when I get rid of it from desktop? – amorfis May 1 '11 at 14:20

Why not just configure Nautilus to execute by default?

Under Nautilus goto Edit->Preferences->Behavior and click:

"Run executable text files when they are opened"

share|improve this answer
probably not something which most people want to suggest as default, but nevertheless very informative, it can be useful to know that it's possible. – ithkuil Sep 10 '10 at 8:52

Richard's solution does not work for the Unity Desktop which recent Ubuntu versions use by default. To easily create shortcuts in unity you can use the "Main Menu" aka alacarte application which lets you edit programs. Just click the appropriate category and then "Create Item".

share|improve this answer

Your Answer

 
discard

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.