Puppy Linux Discussion Forum Forum Index Puppy Linux Discussion Forum
Puppy HOME page : puppylinux.com
"THE" alternative forum : puppylinux.info
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

The time now is Tue 22 Jul 2014, 13:33
All times are UTC - 4
 Forum index » House Training » HOWTO ( Solutions )
Persistent startup sound for Lucid, may work in some others
Moderators: Flash, Ian, JohnMurga
Post new topic   Reply to topic View previous topic :: View next topic
Page 1 of 1 [8 Posts]  
Author Message
TLM


Joined: 09 Mar 2010
Posts: 173
Location: Central United States

PostPosted: Tue 07 Feb 2012, 23:48    Post subject:  Persistent startup sound for Lucid, may work in some others  

I have always wanted to have a startup sound in puppy. I have a script that will play a sound when you boot up Lucid, and it should work in several other puppies as well. I was aware that Lucid puppy barks on first run, as well as when you launch the Personalize Settings application. I traced down this down to the file countrywizard.qs which is located in /usr/sbin.

First, i made a copy of the file countrywizard.qs. Then, using a text editor, i stripped out everything except the part that plays the sound. I renamed the modified file startup-sound.qs and placed it in my /root/Startup folder.

NOTE: This script will also work when placed into the /etc/init.d directory.

The modified file is as follows:

Code:
#!/bin/sh

#if [ "`grep 'alias snd\-card\-0' /etc/modprobe.d/alsa.conf`" != "" ];then #101017
    aplay /usr/share/audio/startup.au &
     #wavplay /usr/share/audio/startup.wav &
    RETAPLAY=$?
    PIDAPLAY=$!
#   fi

 
 fi
 
exit 0


It is also necessary to make sure the script points to your desired sound. In my case, i used pawdio converter to make two sounds; startup.wav and startup.au. I placed these sounds in the /usr/share/audio directory so the script would find them. I believe the wavplay line is commented out, so a .wav file is probably not necessary. The code most likely needs cleaned up a little, but it works as is. This script works in lucid 525 and 528. I have not tested it in others yet.

Last edited by TLM on Sun 01 Jul 2012, 12:23; edited 1 time in total
Back to top
View user's profile Send private message 
shadower_sc

Joined: 21 Apr 2010
Posts: 129
Location: Texas

PostPosted: Tue 14 Feb 2012, 11:21    Post subject: Awesome. :-)  

That is a simple way to do it. I like it.

There are a couple of minor things that should be changed in your script.

It looks like the opening and closing if statements are commented out. That is fine. What looks odd is at the bottom of your script you have a closing "fi" statement without an opening "if" statement.

I am curious about the "Exit 0" statement at the bottom. I don't think it is needed, but I really don't know what it does. Smile Does it close the program that was opened to run the sound? Is it an extraneous part of the original script?
Back to top
View user's profile Send private message 
TLM


Joined: 09 Mar 2010
Posts: 173
Location: Central United States

PostPosted: Tue 14 Feb 2012, 12:25    Post subject: Re: Awesome. :-)  

shadower_sc wrote:
That is a simple way to do it. I like it.

There are a couple of minor things that should be changed in your script.

It looks like the opening and closing if statements are commented out. That is fine. What looks odd is at the bottom of your script you have a closing "fi" statement without an opening "if" statement.

I am curious about the "Exit 0" statement at the bottom. I don't think it is needed, but I really don't know what it does. Smile Does it close the program that was opened to run the sound? Is it an extraneous part of the original script?


Sorry i cannot help there! I have not yet gotten into script writing. Like i mentioned in the original post, this is a hacked version of the countrywizard.qs script (the script in puppy that barks at startup. I just made a copy of it, hacked out everything but the audio parts, changed the lines to reflect the name of the sound i wanted it to play. I did leave the original countrywizard.qs script intact, just made a copy, hacked and renamed it, and got lucky and it worked! If you want to examine the original countrywizard.qs script, it is in /usr/sbin
Back to top
View user's profile Send private message 
oldyeller


Joined: 15 Nov 2011
Posts: 772
Location: Mishawaka IN

PostPosted: Thu 28 Jun 2012, 15:00    Post subject:  

Hi TLM,

How did you do the sound in Patriot for it to play at startup and shutdown?

I have been wanting to do the samething
Back to top
View user's profile Send private message 
Karl Godt


Joined: 20 Jun 2010
Posts: 3953
Location: Kiel,Germany

PostPosted: Sun 01 Jul 2012, 09:26    Post subject:  

oldyeller wrote:
Hi TLM,

How did you do the sound in Patriot for it to play at startup and shutdown?

I have been wanting to do the samething

I would put the script snipplet into a file in the /etc/init.d directory named like 999_2barks.init so it starts after 10_alsa in Puppy 5 series .
Back to top
View user's profile Send private message Visit poster's website 
TLM


Joined: 09 Mar 2010
Posts: 173
Location: Central United States

PostPosted: Sun 01 Jul 2012, 12:21    Post subject:  

Karl Godt wrote:
oldyeller wrote:
Hi TLM,

How did you do the sound in Patriot for it to play at startup and shutdown?

I have been wanting to do the samething

I would put the script snipplet into a file in the /etc/init.d directory named like 999_2barks.init so it starts after 10_alsa in Puppy 5 series .


Yes, the script will load the startup sound sooner if placed into directory /etc/init,d

I have done it this way in my two latest puplet releases, Diamond and PatriotOS. In fact, i believe a person could place one copy of the script in /etc/init.d, and another copy in /root/startup if one desired TWO sounds to play, one prior to desktop load and one after. They could even be different sounds. Lots of things you can do with this script. You can add an exec line of code to it to cause it to launch a program with a sound. This is how it works in PatriotOS for the shutdown sound. I placed the script in /usr/bin as follows:

Code:
#!/bin/sh


#if [ "`grep 'alias snd\-card\-0' /etc/modprobe.d/alsa.conf`" != "" ];then #101017
    aplay /usr/share/audio/shutdown.au &
     #wavplay /usr/share/audio/shutdown.wav &
    RETAPLAY=$?
    PIDAPLAY=$!
#   fi
exec /usr/bin/ali-logout
 
 fi
 
exit 0


Note the exec line invokes ali-logout, which is the shutdown manager i use. Then it is simply a matter of linking all shutdown options in the menu to this script. When actuated, the sound plays and the exec line executes whatever you tell it to. You could just as easily make the exec line launch your browser or any other program. With sound! Very Happy
Back to top
View user's profile Send private message 
TLM


Joined: 09 Mar 2010
Posts: 173
Location: Central United States

PostPosted: Sun 01 Jul 2012, 12:30    Post subject:  

oldyeller wrote:
Hi TLM,

How did you do the sound in Patriot for it to play at startup and shutdown?

I have been wanting to do the samething


Get the following files from my PatriotOS of Diamond puplet in the Puppy Derivatives section of this forum:

shutdown-sound.qs (located in /usr/bin)

AND

startup-sound.qs (located in /etc/init.d)

Place them into your puplet. Open the scripts with a text editor and note the lines that denote wav and au sounds. The default file path for the sounds is /usr/share/audio

You need to make very sure to place your sounds into /usr/share/audio and modify the two files above to point to your sounds. The scripts will not play the sounds if they cannot find them. You can use different directories if you wish, so long as the path to the sounds is modified in the scripts as well.

VERY IMPORTANT: for the shutdown-sound.qs, it is written to point to my shutdown program (ali-logout) You will need to modify the exec line in it to point to your shutdown option, which will vary depending on what windowmanager you are using. Hope this helps. Cheers all. Very Happy
Back to top
View user's profile Send private message 
oldyeller


Joined: 15 Nov 2011
Posts: 772
Location: Mishawaka IN

PostPosted: Sun 01 Jul 2012, 14:59    Post subject:  

To Karl Godt,

Thanks for the info

To TLM,

I will give it a go Thanks for the code and how to do it.

It sure is nice to be able to customize the sound

Thanks
Back to top
View user's profile Send private message 
Display posts from previous:   Sort by:   
Page 1 of 1 [8 Posts]  
Post new topic   Reply to topic View previous topic :: View next topic
 Forum index » House Training » HOWTO ( Solutions )
Jump to:  

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.0702s ][ Queries: 12 (0.0038s) ][ GZIP on ]