Nautlius: add mouse right-click action to compute MD5 sum [duplicate]
Context: 16.04
How does one mouse right-click action to compute the MD5 sum of a file?
You can work with a nautilus script.
-
Create the scripts directory if it does not yet exist
mkdir -p ~/.local/share/nautilus/scripts/
-
Place your script into that directory and make it executable (
chmod +x <name_of_script>
or via your file manager: right-click file, properties). Any executable script you put there will be available under an entry "Scripts" in your right-click menu.In your script, you can use the variable
NAUTILUS_SCRIPT_SELECTED_FILE_PATHS
to retrieve a newline-delimited list of selected files (i. e., one file path in case you selected a single file). You will also need to display the output: this can be done by piping the output of the command to zenity. This simple script will already cut it:#!/bin/bash set -eu -o pipefail md5sum "$NAUTILUS_SCRIPT_SELECTED_FILE_PATHS" | zenity --text-info