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 written a tool in python which i want to be able to launch from the right click of the folder in the File and folder explorer... and I want to pass the folder i right click as argument to the python script !!

share|improve this question
    
Are you using nautilus as your explorer? –  Bolt64 Dec 29 '13 at 14:39
    
yes, exactly.. why ? –  san Dec 29 '13 at 14:43
2  
You may be interested in python-nautilus which will enable you to directly integrate your script using the nautilus python bindings. –  Takkat Dec 29 '13 at 21:08

1 Answer 1

First check the version on Nautilus:

nautilus --version
  • If 3.6 or above go to the folder: ~/.local/share/nautilus/scripts
  • Else go to ~/.gnome2/nautilus-scripts

Now you should be able to just put a script in this folder. This works for bash (right click and there is an option called scripts), I think it works for python too. If the python script does not appear then you may have to make a bash script to call the python. Remember to make your script executable! Also check out this link for more info (such as variables nautilus defines when your run scripts from right clicking, such as the folder or the file you clicked on).

share|improve this answer
    
Well this seems very easy, tomorrow morning I will give it a try! Thanks –  san Dec 29 '13 at 17:48

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.