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 would like to create a shortcut which will cd to a particular directory and then execute a .sh file, thereby opening my application.

At the moment I enter the following into the terminal:

cd /opt/intel/vtune_amplifier_xe_2013

then

source amplxe-vars.sh

and

amplxe-gui

so I create an executable file on the desktop which has:

source /opt/intel/vtune_amplifier_xe_2013/amplxe-vars.sh
amplxe-gui

and set it's properties to be executable. However, when I double click and choose run or run in terminal, it doesnt open the application. However the exact same commands work in terminal?

share|improve this question

1 Answer 1

To create a shortcut on your desktop follow these steps:

  1. Create a file with a name of your choice and with the extension .desktop

    e. g. minecraft.desktop

  2. Open the file with your text editor (File > Open... or Drag and Drop)

  3. Inside the file type the following:

    [Desktop Entry]
    
    Encoding=UTF-8
    
    Name={Name Of The Application Of Anything Else}
    
    Comment={Optional}
    
    Exec=/bin/sh "{directory of the script e. g. /home/zignd/script.sh}"
    
    Icon={directory of the icon (Optional) e. g. /home/zignd/Pictures/Icon.png}
    
    Categories={(Optional) e.g. Games,Media,Development}
    
    Type=Application
    
    Terminal=0
    

    Note that you need to delete the the brackets and what is inside it. You can also use this shortcut in the launcher just drag and drop it.

  4. Save it and enjoy your shortcut.

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.