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 !!
Asked
Active
Viewed 1,524 times
0
-
Are you using nautilus as your explorer? – sayantankhan Dec 29 '13 at 14:39
-
yes, exactly.. why ? – Ciasto piekarz Dec 29 '13 at 14:43
-
2You 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 Answers
3
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).

Julian Stirling
- 2,889