Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

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.

share|improve this question

migrated from askubuntu.com Dec 3 '11 at 12:36

This question came from our site for Ubuntu users and developers.

add comment

2 Answers 2

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

    #!/bin/sh
    /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

share|improve this answer
add comment

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

#!/bin/sh
mplayer '/path/to/file/music.mp3'

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

share|improve this answer
    
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
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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