From time to time I come up with ideas of actions I'd like to have available in the context menu of Nautilus. How do I add them there? Is there something like a Thunar UCA plugin for Nautilus?
|
|
|
Context menus of Nautilus used to be customizable by Nautilus extensions. Be warned that this link leads to archived doc; Gnome devs removed that documentation and no longer support that kind of customization. It may still work though. You can also place plain shell scripts under the |
|||||||||||||||||
|
Nautilus ActionsWe may define our own right-click context menu items with nautilus-actions
|
|||||||||||||
|
|
One can Use python-nautilus extension as an alternative to To install:
A simple example:
Copy this python script under |
|||||||||
|
|
If you want to be able to do something at any time, do like ulidtko says and use If you want to be able to customize when you see it, install the nautilus-actions package, then go to System->Preferences->Nautilus Actions Configuration. |
||||
|
|
|
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:
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. |
|||
|
|
TL;DRThe best solution for app developers is to use python-nautilus. Create your python script (following examples and bad documentation) and copy it to the correct folder:
Detailed ExplanationLet's say you want to create an application that the user installs with a script or a Nautilus ActionsThis is the only solution to offer a GUI and therefore makes it easy to create complex behavior, for example decide what menu entries to show if the selected file's mime-type is The main problem with this solution is that it is not easy (if even possible) to import the entries to another computer without the Configuration Tool and the user importing it, let's just say it would not be possible to do with a script. Nautilus ScriptsThis is the more straight forward solution, pick up a script, place it in a folder and done. This would definitely allow a install script or a
A good app doesn't use shortcuts like this, because it ruins the user experience. python-nautilusNot as easy to create as the previous solutions, but offers the best of both worlds. Scripting and customization. This solution allows you to create a python script that receives the files selected in nautilus and let's you decide if you wish to show a entry or not and what to do with that entry. It also allows you to create sub-menus and or cool stuff. The drawback is the big lack of documentation and developers that just want to add an entry may find themselves losing a couple of hours to create a working prototype (In my research I found a solution based on C that was way more complicated than this). I normally use Visual Studio Code, while on Windows it offers a context menu entry Hope this explanation helped you decide what to choose. |
||||
|
|


