Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I have a shortcut to a shell script on my desktop, and when i double click it the run in terminal/display/cancel/run dialog appears. Is there any way to set a default action for this dialog?

share|improve this question
add comment

1 Answer

up vote 3 down vote accepted

I would suggest you create a desktop launch icon for the file. Here is how:

  1. Make sure your file is an executable, e.g. chmod 755 myScript.sh
  2. Create a file on your desktop called myscript.desktop. The .desktop extension is important.
  3. Open the file in your favorite text editor and append the following text:

    [Desktop Entry]
    Name=myScript
    Comment=Some Comment
    TryExec=/path/to/the/script
    Exec=/path/to/the/script
    Icon=/path/to/icon/if/you/wish
    Categories=Multimedia;
    Terminal=false
    Type=Application
    StartupNotify=true
    
  4. Now, right click on the file -> Properties -> Permissions: Check Execute: Allow executing file as program.

Now, you would have a launcher on your desktop with an icon and everything. If you want Unity Dash to find it, just drop a copy of the file in /usr/share/applications/

share|improve this answer
add comment

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.