Comment 69 for bug 214370

Revision history for this message
Nelux (manolollr) wrote :

This works for me: (you need sox installed. $sudo aptitude install sox)

To sound when you logout, put this code in /etc/gdm/PostSession/Default:

#!/bin/sh
sleep 1
nohup play /usr/share/sounds/ubuntu/stereo/desktop-logout.ogg &
exit 0

It doesn't work without sleep 1, because the session closes too fast.

To sound when you shutdown or reboot:

- In /etc/init.d create a file called, for example, logout-sound. Assign it execution permission and put in it this content:

#!/bin/sh
play /usr/share/sounds/ubuntu/stereo/desktop-logout.ogg
exit 0

- In /etc/rc0.d create a symbolic link to logout-sound /etc/rc0.d$sudo ln -s ../init.d/logout-sound S05logout-sound
- Do the same for /etc/rc6.d

And that's all. The sound first plays, and then the system closes, so please, don't play the 14 minutes song in a gadda da vida by Iron Butterfly :-)