Для Ubuntu 14.04 я модифицировал скрипт, чтобы устранить ошибки, которые я получал из-за некоторых нежелательных пробелов и потока программ, и сделал некоторые другие незначительные настройки
#!/bin/bash
#
# Name of script: empty-trash.sh
# script to empty trash with confirmation and empty trash sound event
# This script is located in /usr/local/bin
# original script created trash.lst in the trash and so never reported "trash is empty"
# modified script to create trash.lst elsewhere and only remove it if the trash was to be emptied.
# utilized mplayer to play the sound rather than the original program as I didn't see the need to install another program.
# also removed some spaces that were causing the script to throw errors
SOUND=/usr/share/sounds/ubuntu/stereo/GarbageTruckSounds.ogg
trash-list > ~/.local/share/trash.lst
file=~/.local/share/trash.lst
if [ ! -s $file ]; then
zenity --info --text "TRASH is EMPTY"
else
zenity --question --title "Confirm Yes/No" --text "EMPTY Trash Bin ?"
case $? in
0)
rm $file
trash-empty;
mplayer "$SOUND"
;;
esac
fi