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.

So I tried making a desktop shortcut which executes a very simple shell script. But when i double click/right click->execute it, it does nothing. (or at least I think it does nothing)

heres how my shortcut and shell script looks: Note the shortcut has "Terminal" set to 1, and i hope that means that it opens the shell script in a new terminal window.. (i have a couple terminals already open, which arent ready for usage (have scripts running))

Shortcut:

[Desktop Entry]
Version=1.0
Type=Application
Name=Test
Comment=Test
Exec=/home/(myusername)/test/test.sh
Icon=utilities-terminal
Terminal=true
StartupNotify=false
GenericName=Test

Shell Script:

#!/bin/sh
# (I tried both, /bin/bash and /bin/sh)
echo "hi"
share|improve this question
add comment

1 Answer 1

Both the desktop entry and the shell script should have executable permissions. Do:

$ chmod +x path_to_shortcut/shortcut.desktop
$ chmod +x path_to_script/test.sh  

Another way to change permissions for a script is to right click it, go to Properties > Premissions and check Allow executing file as program.

Permissions

share|improve this answer
    
it does not fully work but it does execute now. But is that even the right way? I used the right click, create launcher button.. shouldnt that automatically give my launcher execution permission.. hows that user friendly.. thats also the reason why i didnt give it +x myself, i only gave +x to test.sh –  DeadSix17 Feb 19 '13 at 2:03
    
You have to give executable permissions explicitly, see edit to my answer. –  IgnitE Feb 19 '13 at 2:09
    
i told you i did that from the begin (just not on the shortcut).. the problem is that the script doesnt open in a new Terminal, also adding this command opens a terminal though: "/usr/bin/xfce4-terminal" so i thought hm.. probably terminal allows argument 1 to be a shell script .. and i tried that.. but doesnt work. So to make it more easy to understand what i need, i want a Shortcut that opens a NEW! Terminal and runs a specific Shell Script in it. (I did add execution permissions to both, the shortcut and the Script) Also tried running terminal itself and gave it a shell script path as arg –  DeadSix17 Feb 19 '13 at 2:24
    
As you have set Terminal=True, your script should have opened in a terminal itself or you want two terminals? –  IgnitE Feb 19 '13 at 2:35
    
No, i want a single terminal to open even if there are already X ammount of terminals open. –  DeadSix17 Feb 19 '13 at 2:35
show 1 more 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.