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 managed to add .sh files as launcher shortcuts. Now, I want to add a python script in the launcher as shortcut.

I want it to be executed like when it would get executed in the terminal when the following command is run:

python pythonscript.py

Can it also be added in the launcher?

How can I do it?

share|improve this question
    
Umm...downvote?? –  Nirmik May 28 '12 at 13:42

1 Answer 1

up vote 3 down vote accepted
X-Ayatana-Desktop-Shortcuts=python

don't forget to add above line if doesn't exists(if already exists then append name from [ ])

[python Shortcut Group]
Name=Python
Exec=python /path/to/script/script.py
TargetEnvironment=Unity
share|improve this answer
    
Where to add this? in a new .desktop file? –  Nirmik May 28 '12 at 9:29
3  
You can also add a bang line to the very top of your script to get rid of python call. A good bang line could be: #!/usr/bin/env python –  jasmines May 28 '12 at 9:31
    
in existing one or you can create launcher having so many quick list. –  virpara May 28 '12 at 9:33
    
@jasmines you are right. –  virpara May 28 '12 at 9:34
    
@jasmines...Oh that workd amazingly..!! –  Nirmik May 28 '12 at 12:33

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.