Hello Mint community!
I've been trying for a few hours to install a custom shut-down sound (that was quite hard, btw, I'm surprised that there's no application for that yet!) and I'm currently stuck.
As most of you probably know (or not, there's a first time for everything), mint currently have a glitch that prevents it to play it's shutdown sound properly since it uses pulseaudio to do so and that, as the shutdown routine is curently set, it is killed before it had the time to even start playing it. So I decided to work arround it and use aplay instead, but...
I can't find any way to set the "Quit..." menu to follow a custom routine without totally breaking my computer (sure, using a shell script instead of shutdown may seem like a clever idea at first, but if it doesn't take arguments, it might end up causing a lot of trouble just to get a lil chime on shutdown)
So if anyone here can help me (googling gave nothing good), I'd be quite thankful!
[FIXED]Shutdown sound with aplay
Forum rules
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
[FIXED]Shutdown sound with aplay
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 2 times in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
- Pilosopong Tasyo
- Level 6
- Posts: 1432
- Joined: Mon Jun 22, 2009 3:26 am
- Location: Philippines
Re: Shutdown sound with aplay
Try runlevels - http://www.debian-administration.org/articles/212
o Give a man a fish and he will eat for a day. Teach him how to fish and he will eat for a lifetime!
o If an issue has been fixed, please edit your first post and add the word [SOLVED].
o If an issue has been fixed, please edit your first post and add the word [SOLVED].
Re: Shutdown sound with aplay
Allright, so what I should do is:
1. sudo gedit /etc/init.d/aplay
2. ????
3. ln -s /etc/rc0.d/S10aplay /etc/init.d/aplay
4. chmod 755 /etc/init.d/aplay
5. PROFIT?
I'm really not sure how I should arrange that script.
It looks really dangerous to do that when you're fairly novice at bash scripting like I am (chaining commands is still allright, but making complete scripts that supports arguments and stuff is a no-go)
I'm just trying to execute "aplay /home/user/foo/shutdown.wav" right when the shutdown sequence starts while refraining it from going further before aplay is done executing.
1. sudo gedit /etc/init.d/aplay
2. ????
3. ln -s /etc/rc0.d/S10aplay /etc/init.d/aplay
4. chmod 755 /etc/init.d/aplay
5. PROFIT?
I'm really not sure how I should arrange that script.
It looks really dangerous to do that when you're fairly novice at bash scripting like I am (chaining commands is still allright, but making complete scripts that supports arguments and stuff is a no-go)
I'm just trying to execute "aplay /home/user/foo/shutdown.wav" right when the shutdown sequence starts while refraining it from going further before aplay is done executing.
- Pilosopong Tasyo
- Level 6
- Posts: 1432
- Joined: Mon Jun 22, 2009 3:26 am
- Location: Philippines
Re: Shutdown sound with aplay
First, gedit is a GUI-based text editor. In lieu of sudo (which is used for non-GUI commands), use gksudo. Second, I'd suggest you use a less ambiguous shell script name. There's already an aplay command located in /usr/bin. So, instead of /etc/init.d/aplay, use /etc/init.d/myshutdownwav, for example.1. sudo gedit /etc/init.d/aplay
Let's keep it simple. The content of the myshutdownwav script would be something like the following:2. ????
Code: Select all
#!/bin/sh
aplay /home/user/foo/shutdown.wav
I believe the proper way to install this script is to use the update-rc.d command. But for a quick and dirty fix, creating a symlink does the job as well. Now, instead of S10, use K10 or a lower number. What's important is (the symlink to) myshutdownwav script gets called ahead of other scripts in the rc0.d folder. On my end, the first symlinked script in the rc0.d folder is K20hddtemp. K10myshutdownwav looks like a good candidate.3. ln -s /etc/rc0.d/S10aplay /etc/init.d/aplay
Don't forget to put sudo before chmod, and change /etc/init.d/aplay to a less ambiguous filename.4. chmod 755 /etc/init.d/aplay
Ok you got me here. I don't get what you meant by 'profit.' But if all goes well, the changes will take effect immediately. At this point, shutdown the computer to test it for yourself.5. PROFIT?
Before I wrote this reply, I did a test with a 44-second wav file. I shutdown the computer and it played the whole 44 seconds without any cuts. It works as intended.
HTH and good luck.
o Give a man a fish and he will eat for a day. Teach him how to fish and he will eat for a lifetime!
o If an issue has been fixed, please edit your first post and add the word [SOLVED].
o If an issue has been fixed, please edit your first post and add the word [SOLVED].
Re: Shutdown sound with aplay
Allright, thank you very much! I appreciate that you took the time to test the script on your own computer before posting.Pilosopong Tasyo wrote: gksudo gedit /etc/init.d/shutdownsoundln -s /etc/init.d/shutdownsound /etc/rc0.d/K10aplayCode: Select all
#!/bin/sh aplay /home/user/foo/shutdown.wav
sudo ln -s /etc/init.d/shutdownsound /etc/rc0.d/K10aplay
sudo chmod 755 /etc/init.d/shutdownsound
It's from South Park I think, it's just a very popular twist that's often added in a series of steps that don't go anywhere.Pilosopong Tasyo wrote:Ok you got me here. I don't get what you meant by 'profit.5. PROFIT?
EDIT:
Why can't the actual distro have this?
Have they planned to fix this issue?