[SOLVED] Empty Trash sound effect option missing?

Forum rules
Before you post please read how to get help
Post Reply
User avatar
spamegg
Level 8
Level 8
Posts: 2224
Joined: Mon Oct 28, 2019 2:34 am

[SOLVED] Empty Trash sound effect option missing?

Post by spamegg »

My /usr/share/mint-artwork/sounds has 14 sound files in it, including one trash.oga (see trash.jpg)
However my Sounds settings only display 13 options, which all work correctly and play the sound (see sounds.png)
Emptying the Trash does NOT play any sound.
How to get the Empty Trash sound effect enable/disable option?

Code: Select all

bora@bora-desktop:~$ inxi -S
System:
  Host: bora-desktop Kernel: 4.15.0-66-generic x86_64 bits: 64 
  Desktop: Cinnamon 4.2.4 Distro: Linux Mint 19.2 Tina 
Attachments
sounds.png
trash.jpg
Last edited by spamegg on Tue Oct 29, 2019 12:55 pm, edited 1 time in total.
ParaDice
Level 4
Level 4
Posts: 210
Joined: Sat Aug 27, 2016 6:38 am
Location: Germany

Re: Empty Trash sound effect option missing?

Post by ParaDice »

I suppose the sound file is just there so that this feature can be implemented in future releases of Cinnamon (or it was forgotten in past ones :D). If you don't want to mess with the code, your best options are to file a bug report/feature request and wait for the next version of Cinnamon.
To get help, always post your system configuration. Open a terminal (Ctrl + Alt + T), type the following command and copy its output: inxi -Fxxxrz. To preserve formatting, please make sure to post it inside [ code] [/ code] blocks.
User avatar
spamegg
Level 8
Level 8
Posts: 2224
Joined: Mon Oct 28, 2019 2:34 am

Re: [SOLVED] Empty Trash sound effect option missing?

Post by spamegg »

Found a workaround:

Create a folder /home/yourusername/Sounds
Put your sound file in there: say trash.mp3
Install some command line sound player, mpg123 or mplayer:

Code: Select all

sudo apt install mplayer
Create a folder /home/yourusername/Scripts
Save the following code as something like trash.sh and put it in above folder:

Code: Select all

#!/bin/bash
cd /home/yourusername/.local/share/Trash/files
while true
do
    TOT1="$(ls -1 | wc -l)"
    sleep 1
    TOT2="$(ls -1 | wc -l)"
    if [ "$TOT1" -gt "$TOT2" ];
    then
        mplayer /home/yourusername/Sounds/trash.mp3
    fi
done
Make sure to change the permissions of trash.sh to make it executable by right clicking on it, clicking Properties, then under Permissions, checking the Execute boxes.

Then go to Menu, Startup Applications
Click the Plus sign and choose "Custom Command"
For name, type something like "Empty Trash Sound Event"
Click Browse, select your script in /home/yourusername/Scripts/trash.sh
For comment, type something like "Plays sound effect when Trash is emptied"
Click Add, and restart Mint.
Post Reply

Return to “Sound”