🔍 See Original Answer on Ask Ubuntu 🔗
Trying to Add A Feature to Nautilus
November 30, 2016
November 24, 2022
Copy to clipboard: false
You don’t need the source code so don’t worry about downloading foo and patching it.
See Nautilus instructions for creating your own script here (Help Ubuntu - Nautilus Scripts How to). Basically you:
- Navigate to the directory
- Place your script (written in Bash, Perl or Python) there.
- Mark the script as executable using Nautilus or from terminal with
chmod +x script_name
- Nautilus makes environmental variables available to your script: NAUTILUS_SCRIPT_SELECTED_FILE_PATHS, NAUTILUS_SCRIPT_SELECTED_URIS, NAUTILUS_SCRIPT_CURRENT_URI, and NAUTILUS_SCRIPT_WINDOW_GEOMETRY
There are sample scripts located at (Help Ubuntu - Nautilus Sample Scripts) for e-mailing files, mounting an ISO file, setting files to read only, editing file with gedit ROOT priviledges, opening terminal at current location, etc.
Look through the scripts and take one as a template for encrypting files using right-click.