I would like to be able to enable some sound file to play whenever I suspend and wake up my netbook (MSI Wind u100) but I can't found a way to do this in gnome shell.

I'm using PinguyOS 11.10, which is Ubuntu 11.10 based distro.

The idea is to make my netbook to basically greet me every time I wake up from suspend. Something like "Welcome back, Master" announced by a sexy robotic voice.


Try putting a script in /etc/pm/sleep.d/. Scripts in this folder gets launched on resume from sleep.

The file could look something like this

mplayer '/path/to/file/music.mp3'

Don't forget to run the command chmod +x yourscriptfilename so that the file is executable.

  • The script itself is working great and is executable, however it doesn't seem to work after a suspend. I've put sleep 5 to delay mplayer in case script loads faster than pulseaudio but it didn't help. – xArijus Dec 11 '11 at 12:53

Do you have "libcanberra" installed? I am running Fedora18--gnome, and currently I have an "autostart" script for the login sound that executes the following command:

Exec=/usr/bin/canberra-gtk-play -f /home/user/.local/share/sounds/.../desktop-login.ogg

Try this, if you want:

  1. Place the sound-file (if it's not already) in /usr/share/sounds

  2. Create a script, as already suggested in /etc/pm/sleep.d containing something like

    /usr/bin/canberra-gtk-play -f /path/to/sound/file

As I said, my login-sound file is a simple desktop-entry in the ~/.config/autostart directory with the aforementioned "Exec=..." line along with everything else that goes in a Desktop Entry, of course. Best of luck

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.