Пустой случайный звук?

есть ли способ добавить звуковое событие каждый раз, когда я пустой мусор в моей версии Ubuntu 12.04.2 lts i386. ?

1
задан 4 December 2013 в 22:40

1 ответ

Для 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 
1
ответ дан 24 May 2018 в 18:47

Другие вопросы по тегам:

Похожие вопросы: