A quick wiki on how to customise Nemo’s context menu to have some options you may want. In this example, I’ve decided to add two archive manager-based options, but you can add more, like “Open in Meld”, “Open in Ranger”, etc.
To find the correct command for the program you’d like to load, open a terminal and type the program name followed by “-h
” or “--help
”.
Another option is to type “man programName” to open the manual.
Example:
meld -h
NEMO
This first action will extract files from an archive in the current directory and close immediately.
[Nemo Action]
Active=true
Name=Extract Files...
Comment=Extract archives here
Icon-Name=archive-extract
Exec=engrampa -h %F
Selection=Any
Extensions=any;
Quote=double
Note: Where the actions says “Extensions=any;", you may add specific filetypes. However, this is not recommended as there are many filetypes that use a compression method (LibreOffice files, Krita files, etc.) that could be accessed/extracted in case there is an issue opening the file with its default app.
If you decide to add specific filetypes, then do it like so:
Extensions=exe;dll;msi;zip;gz;bz2;7z;rar;tar;xz;iso;zst;cbz;cbr;ora;svg;
The second action will use engrampa
to compress all your selected files.
[Nemo Action]
Active=true
Name=Compress...
Comment=Create a compressed archive
Icon-Name=archive
Exec=engrampa -d %F
Selection=Any
Extensions=any;
Quote=double
Finally, like the Arch wiki says: save the actions in the folder below with the extension .nemo_action
.
~/.local/share/nemo/actions/coolActionName.nemo_action
Why not just use file-roller
?
Well, recently, file-roller has started using libadwaita. This means if I want to compress something, and I use a dark theme, I’ll get a big light-themed window now. So, rather than give myself a headache when compressing files in the dark, I’ve switched to Engrampa instead.
Why not just right-click and choose “Open With”, then click on Engrampa?
Because that’s an extra menu/step (a few, actually), and I don’t want to use the “Open With” dropdown unless I am selecting an alternative to my default program.
What about using Xarchiver instead?
Engrampa uses a similar base as Gnome’s original file-roller prior to the libadwaita update, so it will both look familiar and be more compatible when it comes to the commands and/or UI/UX.
Of course, if you prefer Xarchiver or even Ark, you should be able to create an action with the same or similar functionality.
Why not just use nemo-engrampa from the AUR?
Good point. But also, actions can’t break in a failed AUR update…
MELD
[Nemo Action]
Active=true
Name=Compare in Meld
Comment=Compare the selected files and folders in Meld
Icon-Name=meld
Exec=meld --diff %F
Selection=Any
Extensions=any;
Quote=double
PS: If there are any unnecessary parts in the actions I’ve given as examples, please let me know.
Edit: Added icons to the three examples, and added more extension examples.
A few more Nemo Actions I’ve made, including other scripts, can be found below.
Extra: Useful and "Use Less" Scripts