10-11-2014, 05:19 PM
It's woking here
https://www.youtube.com/watch?v=m9oTyvhE...e=youtu.be
I made this other script, but it's not for thunar custom action.
This script opens a dialog and then you choose a file.
https://www.youtube.com/watch?v=m9oTyvhE...e=youtu.be
I made this other script, but it's not for thunar custom action.
This script opens a dialog and then you choose a file.
Code:
#!/bin/bash
# Set the default directory for the file selection dialog
cd $HOME/Downloads
# Select a file
md5_file=(`zenity --title="MD5sum" --file-selection --file-filter="*.iso *.ISO *.img *.IMG"`)
# If Cancel is clicked then exit
if [ "${PIPESTATUS[0]}" -ne "0" ]; then
exit 0
fi
# Start MD5sum of a selected file
md5sum $md5_file | tee >(cut -d ' ' -f1 > /tmp/sum) |zenity --progress --title="MD5sum" --text="Calculating md5sum for:\n${md5_file##*/}" --pulsate --auto-close
# If Cancel is clicked then remove temporary file and exit
if [ "${PIPESTATUS[2]}" -ne "0" ]; then
rm /tmp/sum
exit 0
fi
# Display calculated md5sum
sum=`cat /tmp/sum`
zenity --info --title="MD5sum" --text="MD5sum : $sum\nFile : ${md5_file##*/}"
# If you want to make an md5sum file, uncheck the next line
# echo $sum > "$md5_file".md5sum
rm /tmp/sum