Moves file/folder to trash directory with $1 (eg, "trash myfile"). Without $1 (eg, "trash"), prompts
for deleting. Edit PATH (script will create/remove directory).
For use with DFM, create icon. Set shellcommand to "aterm -e !0!". Drag files to icon (move), or click for viewing/deleting.
#!/bin/ash
#### trash.sh script, jeters
### deletes $1 files/folders; without $1, prompts to view/delete
## Edit PATH:
TRASH="/mnt/hda3/tmp/trash"
. /etc/init.d/tc-functions
[ -d /mnt/hda3/tmp/trash ] || sudo mkdir -p ${TRASH}
if [ $1 ]; then
sudo mv "$@" ${TRASH}
else
if [ "$(ls ${TRASH})" ]; then
clear
ls ${TRASH}
echo "_____________"
echo ${GREEN}"delete? (y)"${NORMAL}
read RESPONSE
case ${RESPONSE} in
"y" ) sudo rm -R ${TRASH} ; echo ${RED}"deleted!" ${NORMAL}; sleep 1 ;;
"*" ) break ;;
esac
else
echo ${GREEN}"Empty" ${NORMAL}; sleep 1
fi
fi
exit 0