Why not use a Thunar action ?
I had the same problem deleting files on very old and slow usb devices, so I wrote this script:
- Code: Select all
#!/bin/bash
################################################################
# This script is meant to be called from a Thunar custom action:
# /path/to/rmrf %F
################################################################
############################## i18n #############################
title="WARNING !"
question="<b>THIS OPERATION IS IRREVERSIBLE !</b>\nDo You really want to erase:\n"
case $LANG in
######## french ########
fr* )
title="ATTENTION !"
question="<b>CETTE OPÉRATION EST IRRÉVERSIBLE !</b>\nVoulez-vous vraiment supprimer:\n"
;;
# Add your translations here...
esac
######################### Zenity Interface ########################
question=$(
echo $question;
for f in "$@"; do echo $f; done
)
if zenity --question --title="$title" --text="$question"
then
rm -rf "$@"
fi
Saved it as ~/bin/rmrf
and added this action to ~/.config/Thunar/uca.xml
- Code: Select all
<action>
<icon>gtk-no</icon>
<name>rmrf</name>
<command>~/bin/rmrf %F</command>
<description>rmrf selected files</description>
<patterns>*</patterns>
<directories/>
<audio-files/>
<image-files/>
<other-files/>
<text-files/>
<video-files/>
</action>
Now you can select files/folders, right-click and rmrf !!
