Views:
57,445
Votes: 7
Tag :
nautilus
Link:
🔍 See Original Answer on Ask Ubuntu ⧉ 🔗
URL:
https://askubuntu.com/q/855198
Title:
How do I customize the context menu in Nautilus?
ID:
/2016/11/30/How-do-I-customize-the-context-menu-in-Nautilus_
Created:
November 30, 2016
Edited: June 11, 2021
Upload:
September 15, 2024
Layout: post
TOC:
false
Navigation: false
Copy to clipboard: false
November 29, 2016 era Ubuntu 14.04, 16.04 and 16.10 plus earlier versions.
See Nautilus instructions for creating your own script here (Help Ubuntu - Nautilus Scripts How to). Basically you:
- Navigate to the directory
~/.local/share/nautilus/scripts/
- 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
, andNAUTILUS_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, uploading to the cloud, compressing to backup or whatever you need to do.