Nemo Actions

Forum rules
Before you post please read how to get help
Post Reply
sadi
Level 2
Level 2
Posts: 53
Joined: Sat Aug 21, 2010 3:16 pm
Location: Istanbul

Nemo Actions

Post by sadi » Fri Apr 05, 2019 10:08 am

Nemo Actions

Nemo file manager allows users to add entries to its context menu, which means it will take only one click to perform some complex file operations, for example, involving a number of commands. The folder /usr/share/nemo/actions contains some default actions as well as an example of a Nemo action, named sample.nemo_action, which may also be used as a template to create custom Nemo actions.

The file extension for action files is .nemo_action which may be self-sufficient or powered by some executable script file.

There are two directories where custom action files can be placed:
/usr/share/nemo/actions/ for system-wide actions
~/.local/share/nemo/actions/ for user actions

Some Examples and Resources

At the present, Linux Mint does not have a specific place for users to exchange/download custom Nemo actions, so this topic might be a starting point, where users can exchange information, tips, recommendations and custom actions.

The following is a list of git repositories including various Nemo actions created by users, ranging from 3 weeks to 5 years old, ordered here from the newest to the oldest.

Please use them at your own risk!

The fact that they are listed here does not mean they have been tested or they are recommended. It’s just a list created as a result of a simple search for “Nemo actions” at GitHub.

https://github.com/kelebek333/nemo-ffsend
• ffsend.nemo_action

https://github.com/brunetton/nemo-actions
• concatenate_wav.nemo_action
• convert_to_flac.nemo_action
• convert_to_mp3-128.nemo_action
• convert_to_mp3-192.nemo_action
• convert_to_mp3-256.nemo_action
• extract_sound.nemo_action
• flac_to_wav.nemo_action
• image-resize-1200.nemo_action
• image-resize-1500.nemo_action
• image-resize-2000.nemo_action
• image-resize-500.nemo_action
• image-resize-900.nemo_action
• paste_link.nemo_action
• pdf_repair.nemo_action
• pdf_to_djvu.nemo_action
• pdfimages_extract.nemo_action
• remove_empty_dirs.nemo_action
• stabilize_video-dir.nemo_action
• stabilize_video-file.nemo_action

https://github.com/dkebler/paste-link-here
• link-clipboard.nemo_action
• paste-link.nemo_action

https://github.com/kelebek333/nemo-actions
• nemo-refresh.nemo_action
• open-files-as-root.nemo_action
• peazip-add-archive.nemo_action
• peazip-extract-archive.nemo_action
• peazip-open-archive.nemo_action
• print.nemo_action
• printlibreoffice.nemo_action
• python2.nemo_action
• python3.nemo_action

https://github.com/DanielBonnery/System ... mo_actions
• XXXtex.nemo_action
• pdflatexme.nemo_action

https://github.com/DuMuT6p/my-nemo-actions
• enqueue-in-audacious.nemo_action
• force-screen-turn-off.nemo_action
• refreshless-refresh.nemo_action

https://github.com/gcampolucci/New-fold ... -selection
• NewFolderWithSelection.nemo_action

https://github.com/ckrmml/nemo_actions
• open_with_atom.nemo_action
• open_with_gitkraken.nemo_action
• run-with-nvidia.nemo_action

https://github.com/damko/nemo_actions
• compare-meld.nemo_action
• gpg_encr.nemo_action
• lock.nemo_action
• md2html.nemo_action
• md2pdf.nemo_action
• md5hash-check.nemo_action
• md5hash.nemo_action
• normalize_name.nemo_action
• open_as_root.nemo_action
• pdfshuffler.nemo_action
• recursively_set_std_permissions.nemo_action
• share_pictures.nemo_action
• unlock.nemo_action

https://github.com/schorschii/nemo-acti ... ess-images
• compress-images.nemo_action

https://github.com/cbop-dev/MyTags
Nemo extension and action for tagging files and managing file tags.

https://github.com/diegosanz/nemo-open-with-atom
• atom.nemo_action

https://github.com/felipem775/nemo-actions-scripts
• (CovertImages)toPDF.nemo_action

https://github.com/luluco250/Nemo_OpenWithVSCode
• VSCode_Open_Background.nemo_action
• VSCode_Open_Folder.nemo_action

https://github.com/rodolpheh/nemo-actions
• CompressMultiplePDF.nemo_action

https://github.com/JollyDevelopment/nemo-actions
• compress-dirs.nemo_action
• compress-files.nemo_action

https://github.com/rapgenic/nemo-run-with-nvidia
• run-with-nvidia.nemo_action

https://github.com/erickj/nemo-actions
• deja-dup_restore-missing.nemo_action
• deja-dup_revert.nemo_action

https://github.com/Ragnarokkr/nemo-actions
• MTNA-Folders-TemplateCreator-Photo.nemo_action

https://github.com/Acidburn0zzz/Nemo-UltraCopier
• nemo-ultracopier-folder.nemo_action
• nemo-ultracopier.nemo_action

https://github.com/Alfcx/linux-mint-nemo-actions
• convert-doc-to-odt.nemo_action
• convert-to-pdf.nemo_action
• pdf-downsizer.nemo_action
• pdf-merger.nemo_action
• pdf-metadata-editor.nemo_action
• pdf-rotator.nemo_action
• scan-to-sandwich-pdf.nemo_action

https://github.com/Jubei-Mitsuyoshi/aaa-nemo-actions
• mount-android-image.nemo_action
• mount-virtual-disk.nemo_action
• unsquash_fs.nemo_action
OS: Linux Mint 19.2 Cinnamon 64-bit

User avatar
smurphos
Level 12
Level 12
Posts: 4382
Joined: Fri Sep 05, 2014 12:18 am
Location: Britisher
Contact:

Re: Nemo Actions

Post by smurphos » Sun Apr 07, 2019 4:46 am

I've just uploaded my current collection of nemo actions to a github repo.

https://github.com/smurphos/nemo_action ... on_scripts

Nemo Actions Index

Desktop context menu actions

Close windows actions.

A set of two actions and an associated shell script to allow the user to gracefully close all open windows on the current workspace or all workspaces via right click on the desktop. The script requires wmctrl and xdotool apt install wmctrl xdotool

close_windows_in_workspace.nemo_action
close_all_windows.nemo_action
close_windows.sh


Workspace management actions

A set of six actions to allow easy management of workspaces from the desktop context menu. The next and previous workspace actions require xdotool apt install xdotool

new-workspace.nemo_action
delete-workspace.nemo_action
previous_workspace.nemo_action
next_workspace.nemo_action
workspace_overview.nemo_action
window_overview.nemo_action


Background slide-show actions

An action to quickly toggle the desktop background slide-show, along with an action to select the next wallpaper when the slide-show is active.

toggle_slideshow.nemo_action
next-wallpaper.nemo_action


Session management actions

The first two actions give quick access from the desktop context menu to the shutdown and logoff session dialogues.

session_menu_logout.nemo_action
session_menu_poweroff.nemo_action


These five actions immediately invoke the requested action.

session_reboot.nemo_action
session_shutdown.nemo_action
session_suspend.nemo_action
session_lock.nemo_action
session_logout.nemo_action


General Actions

Open with admin privileges actions

These actions give you a choice of applications to edit text based files with admin privileges.

The sudo_nano action and associated script will open the file in nano a terminal based text editor, elevating privileges only if necessary.

sudo_nano.nemo_action
sudo_nano_check.sh


The xed_admin action and associated script will open the file in the text editor xed elevating privileges with admin:// if necessary.

xed_admin.nemo_action
xed_admin_check.sh


File actions as admin

These actions and their associated shell scripts allow the user to undertake a range of file management activities with elevated privileges if needed from a regular instance of Nemo.

They will all request password authentication if elevated privileges are necessary to complete the action. All require zenity - apt install zenity

Copy/paste (Admin)

Supports single and multiple selections. Uses zenity to select destination.

copy_paste_admin.nemo_action
copy_paste_admin.sh


Cut/paste (Admin)

Supports single and multiple selections. Uses zenity to select destination.

cut_paste_admin.nemo_action
cut_paste_admin.sh


Creating links (Admin)

Supports single selections only . Uses zenity to select destination.

create_link_in_target.nemo_action
create_link_in_target.sh


Create Directory (Admin)

This action has two nemo_action files, one for right-click on a directory, and one for right-click on empty space.

create_dir_admin.nemo_action
create_dir_admin_background.nemo_action
create_dir_admin.sh


Create File (Admin)

This action has two nemo_action files, one for right-click on a directory, and one for right-click on empty space.

create_file_admin.nemo_action
create_file_admin_background.nemo_action
create_file_admin.sh


Delete (Admin)

Supports single and multiple selections.

delete_admin.nemo_action
delete_admin.sh


Rename (Admin)

Supports single selections only.

rename_admin.nemo_action
rename_admin.sh


Bulk rename actions

Both these actions open the bulk rename utility GPrename - apt install gprename One action is for a single folder selection to bulk rename files in that folder. The other is for multiple selections and opens GPrename in the parent folder.

bulk_rename_files.nemo_action
bulk_rename_folders.nemo_action


Media info

Shows information about media files in a separate window. Requires mediainfo-gui - apt install mediainfo-gui

media-info.nemo_action

Search folders

Opens the selected folder in Searchmonkey - apt install searchmonkey for more fine-tuned file system searches including search by contents.

searchmonkey.nemo_action

View a tree-view directory structure in your browser

An action and associated shell script to produce an html tree-view of the directory and file structure below the selected directory. Requires tree - apt install tree

print_tree.nemo_action
print_tree.sh


Copy a random selection of files from a directory

Ever wanted to grab a random selection of music files or pictures from a collection? This action is for you. Uses zenity - apt install zenity to ask the user to confirm number of files and where to paste them.

get_random_file.nemo_action
get_random_files.sh


Toggle checked emblem

An action and associated shell script to quickly add or remove a ✓ emblem to the file/folder.

toggle_checked.nemo_action
toggle_checked.sh


Update a files modification date

touch_file.nemo_action

Check a shell script for errors

This action and associated shell script will check your shell scripts for errors with shellcheck apt install shellcheck Scripts with no issues will be marked with a checked emblem, scripts with warnings will be marked with a warning emblem and the shellcheck output along with the shell script itself will be opened in a text editor for review.

shellcheck.nemo_action
shellcheck.sh
Last edited by smurphos on Sat Apr 13, 2019 8:25 am, edited 4 times in total.
For custom Nemo actions, useful scripts for the Cinnamon desktop, and Cinnamox themes visit my Github pages.

sadi
Level 2
Level 2
Posts: 53
Joined: Sat Aug 21, 2010 3:16 pm
Location: Istanbul

Re: Nemo Actions

Post by sadi » Sun Apr 07, 2019 8:51 am

I've also posted a small selection here: https://github.com/Sadi58/nemo-actions
  • Dir-Search-Text: A simple bash script to search for text in a directory and display list via zenity (dependency)
  • EXIF-Data: A simple bash script to retrieve the metadata of selected audio/video/image file(s) using exiftool (dependency) and display via zenity (dependency)
  • Folder-Contents: A simple bash script to list contents of a directory with several options (filenames/pathnames/recursive) and display list via zenity (dependency)
  • Image-to-JPG: A simple bash script to convert selected image files to jpeg format using convert (dependency)
OS: Linux Mint 19.2 Cinnamon 64-bit

User avatar
smurphos
Level 12
Level 12
Posts: 4382
Joined: Fri Sep 05, 2014 12:18 am
Location: Britisher
Contact:

Re: Nemo Actions

Post by smurphos » Mon Apr 08, 2019 2:39 am

sadi wrote:
Sun Apr 07, 2019 8:51 am
I've also posted a small selection here: https://github.com/Sadi58/nemo-actions
  • Dir-Search-Text: A simple bash script to search for text in a directory and display list via zenity (dependency)
  • EXIF-Data: A simple bash script to retrieve the metadata of selected audio/video/image file(s) using exiftool (dependency) and display via zenity (dependency)
  • Folder-Contents: A simple bash script to list contents of a directory with several options (filenames/pathnames/recursive) and display list via zenity (dependency)
I've just tried these three - very nice indeed. :)

A note of caution and a tip for users trying any action sourced from a third party. If the Icon-Name specifies an icon that doesn't actually exist in the icon path of your system the action won't appear at all in the context menu. So if you are having issues with an action not showing up commenting it's Icon-Name out with a # is a good trouble-shooting step.

Also at least one release of Nemo (I think in Mint 19 IIRC) required actions to use symbolic icons only although that restriction was dropped in the current release.

I neglected to double check that all of the Icon-Names in my uploaded actions exist in Adwaita. A job for tomorrow.

I've also added a few more to my repo that allow file actions (delete, rename. copy/paste) that require admin privileges to be undertaken without having to open nemo as root.
For custom Nemo actions, useful scripts for the Cinnamon desktop, and Cinnamox themes visit my Github pages.

sadi
Level 2
Level 2
Posts: 53
Joined: Sat Aug 21, 2010 3:16 pm
Location: Istanbul

Re: Nemo Actions

Post by sadi » Mon Apr 08, 2019 4:34 am

smurphos wrote:
Mon Apr 08, 2019 2:39 am
A note of caution and a tip for users trying any action sourced from a third party. If the Icon-Name specifies an icon that doesn't actually exist in the icon path of your system the action won't appear at all in the context menu. So if you are having issues with an action not showing up commenting it's Icon-Name out with a # is a good trouble-shooting step.

Also at least one release of Nemo (I think in Mint 19 IIRC) required actions to use symbolic icons only although that restriction was dropped in the current release.

I neglected to double check that all of the Icon-Names in my uploaded actions exist in Adwaita. A job for tomorrow.
I haven't noticed this and tested under my current Linux Mint 19.1 Cinnamon 64-bit system.
If there's an icon problem the action still shows in the context menu and works as usual.
If the icon cannot be found I see a symbolic warning icon instead of a proper one, and if no icon is specified the icon column is blank in the plugins window / actions pane of Nemo.

Maybe such an action will fail if the user has enabled icons in menus?
OS: Linux Mint 19.2 Cinnamon 64-bit

User avatar
smurphos
Level 12
Level 12
Posts: 4382
Joined: Fri Sep 05, 2014 12:18 am
Location: Britisher
Contact:

Re: Nemo Actions

Post by smurphos » Tue Apr 09, 2019 1:37 am

sadi wrote:
Mon Apr 08, 2019 4:34 am
I haven't noticed this and tested under my current Linux Mint 19.1 Cinnamon 64-bit system.
Yeah you are right - I think I'm thinking of whatever nemo version it was where symbolic icons were briefly a requirement, and I think that nemo version has been superseded in whatever Mint release it was in... :roll:
For custom Nemo actions, useful scripts for the Cinnamon desktop, and Cinnamox themes visit my Github pages.

sadi
Level 2
Level 2
Posts: 53
Joined: Sat Aug 21, 2010 3:16 pm
Location: Istanbul

Re: Nemo Actions

Post by sadi » Sun Aug 04, 2019 9:33 am

Linux Mint 19.2 Cinnamon: New feature in Nemo Actions: "The condition for nemo actions can now be an external script or command."

I would be nice if someone could give a couple of examples for this new feature, as the file 0-Sample.Nemo.Action only contains this:
# Conditions - semicolon-separated array of special conditions:
# "desktop" current (parent) folder is desktop
# "removable" target (first selection) is removable
# "gsettings <schema> <boolean key>" is true
# "gsettings <schema> <key> <key-type> <[eq|ne|gt|lt]> <value>"
# "dbus <name>" exists
OS: Linux Mint 19.2 Cinnamon 64-bit

Post Reply

Return to “Scripts & Bash”