View Full Version : [ubuntu] How do I enable logout sound?
theyain
December 30th, 2009, 11:46 PM
I'm trying to use a script I got from gnome-look to enable the logout sound. But no matter what I do, it doesn't work. What am I doing wrong?
#!/bin/sh
PATH="/usr/bin/X11:/usr/X11R6/bin:/opt/X11R6/bin:$PATH:/bin:/usr/bin"
OLD_IFS=$IFS
gdmwhich () {
COMMAND="$1"
OUTPUT=
IFS=:
for dir in $PATH
do
if test -x "$dir/$COMMAND" ; then
if test "x$OUTPUT" = "x" ; then
OUTPUT="$dir/$COMMAND"
fi
fi
done
IFS=$OLD_IFS
echo "$OUTPUT"
}
/usr/bin/canberra-gtk-play --file="/usr/share/sounds/ubuntu/stereo/desktop-logout.ogg"
exit 0
And as an added not, I'm using --file= instead of --id= for canberra-gtk-play because I changed the desktop-logout.ogg file to something I want, thus the --id= option doesn't work anymore.
theyain
January 1st, 2010, 07:20 PM
Bump, help please?
jonny163
April 28th, 2010, 06:37 PM
I'm completely n00b to this but if there is a specified logout noise then surely there is a way to do activate it without having to script anything?
jimmydean886-2
June 25th, 2011, 02:38 PM
From the code, it looks like it is trying to play the Ubuntu logout sound using an application or command called "canberra-gtk-play". Check synaptic to see if you have it. Also, in the first set of url's, (line 3) the folder they refer to is not always x11r6. If you are using an older system, it may be different. Also: I get a message when I shut down that says that PulseAudio is configured on a per-user basis whenever I startup in safe mode, (getting rid of Plymouth) or shut down on my older machine. This basically means that you can't play anything at that point in time-- the user is already logged out. Maybe someone could find a config file which you could change that? It would probably work if only the logout sound sounded before the session has stopped the Pulse-session.
Arny006
November 23rd, 2011, 10:08 AM
Hi,
go to System/Settings/Start Programs or Start Applications and click to start, sorry my system running in German-language!
This application list all auto-start programs! For sure is already a "GNOME Login Sound", if not, click insert and copy/paste following in the respectively fields:
Field: Name: GNOME Login Sound
Field: Command: /usr/bin/canberra-gtk-play --id="desktop-login" --description="GNOME Login"
Field: Comment: Plays a sound whenever you log in
Click Store and you have done!
For Logout-Sound click again insert and copy/paste following in the respectively fields:
Field: Name: GNOME Logout Sound
Field: Command: /usr/bin/canberra-gtk-play --id="desktop-logout" --description="GNOME Logout"
Field: Comment: Plays a sound whenever you log out
Click Store and you have done!
Do you wish the same sound for login and logout? Just use the same command at your choice.
Enjoy
jimmydean886-2
November 23rd, 2011, 01:23 PM
I have been looking for a solution for this for some time now, and have found that there already is a logout sound, Pulseaudio just exits too soon.
Try what you can, I've never seen the logout sound idea as a STARTUP application, only shutdown.
jimmydean886-2
December 3rd, 2011, 07:16 PM
I've found it!
BEFORE YOU CONTINUE: This will disable confirmation for log out, but not shut down, where the dialog will appear AFTER the sound is played.
Open up nautilus as root (gksu nautilus) then navigate to /usr/lib/indicator-session
there you will see two items. Rename the one called "gtk-logout-helper" to "gtk-logout-helper-nosound"
Create a blank file called "gtk-logout-helper" to replace the old one and put this text in it.
#!/bin/bash
/usr/bin/canberra-gtk-play --id="desktop-logout" --description="GNOME Logout"
echo $1
SHUTDOWN="--shutdown"
LOGOUT="--logout"
RESTART="--restart"
if [ $1 = $SHUTDOWN ]; then
/usr/lib/indicator-session/gtk-logout-helper-nosound --shutdown
fi
if [ $1 = $LOGOUT ]; then
gnome-session-quit --no-prompt
fi
if [ $1 = $RESTART ]; then
/usr/lib/indicator-session/gtk-logout-helper-nosound --restart
fi
I designed this so that it could be easily changed to meet a changing os's (Ubuntu's) needs.
Enjoy!
PS: The strategy in the quote below plays the logout sound at login.
Arny006:
Hi,
go to System/Settings/Start Programs or Start Applications and click to start, sorry my system running in German-language!
This application list all auto-start programs! For sure is already a "GNOME Login Sound", if not, click insert and copy/paste following in the respectively fields:
Field: Name: GNOME Login Sound
Field: Command: /usr/bin/canberra-gtk-play --id="desktop-login" --description="GNOME Login"
Field: Comment: Plays a sound whenever you log in
Click Store and you have done!
For Logout-Sound click again insert and copy/paste following in the respectively fields:
Field: Name: GNOME Logout Sound
Field: Command: /usr/bin/canberra-gtk-play --id="desktop-logout" --description="GNOME Logout"
Field: Comment: Plays a sound whenever you log out
Click Store and you have done!
Do you wish the same sound for login and logout? Just use the same command at your choice.
Enjoy
vBulletin® v3.8.7, Copyright ©2000-2012, vBulletin Solutions, Inc.