2

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?

1 Answer 1

4

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/

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .