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?
Instead of linking directly to the .sh file create an application launcher as follows:
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".
You may have to edit the desktop file with something like gedit to add the "Path" of the script. Like This:
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"
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".
I Wanted to make it easier to launch "Dont Starve" for my kids. I started the program with
I added a menu item with Alacarte but it would not work because it was a .sh file.
After many searches, I figured I needed to specify the path for the script.
Add path as explained in Desktop Variables
I located the launcher
Now Launcher file looks like this:
Works like a champ. I Hope this helps someone else. ( I actually run Mint 15 Olivia based on Ubuntu Raring )