I am trying to add a button or right click option to Nautilus for an assignment. When I click the button or right click option it should encrypt the file that is highlighted. But I am getting way ahead of myself. I do not know where in the source code I would add this new button feature. How/Where do I edit the source code of Nautilus to add a button and then add the code for encryption? Any help would be much appreciated.
Asked
Active
Viewed 133 times
2 Answers
2
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
~/.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, 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.

WinEunuuchs2Unix
- 102,282
-
Thanks for this but I do not know any scripting languages and this is for an operating systems assignment. – newbuser Nov 30 '16 at 01:55
-
Well if are taking a Linux C programming course and your instructors didn't teach you some basic bash commands first it reflects poorly on your educational institution. Sorry to say but I honestly believe that to be true. – WinEunuuchs2Unix Nov 30 '16 at 01:59
-
I agree with that you said. Its an operating systems course and I have truly learned nothing. 6 of our 10 weekly exercises were just math issues like read and write times, and the other 4 were simple programming exercises which we learned in our intro to systems programming class. Even the TAs for this class are bashing the prof saying that he has taught us nothing useful. – newbuser Nov 30 '16 at 03:22
0
Install apt-src
, whose man
page says, in part:
To install a local copy of package foo, which you are going to apply a local patch to:
apt-src install foo
cd foo-version
patch <~/my-foo-patch
apt-src build --installdebs foo

waltinator
- 36,399