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 Fri 28 Aug 2015, 23:18
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 [10 Posts]  
Author Message
TLM


Joined: 09 Mar 2010
Posts: 175
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: 135
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: 175
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: 841
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: 4027
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 
TLM


Joined: 09 Mar 2010
Posts: 175
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: 175
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: 841
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 
flyp22


Joined: 08 Jul 2015
Posts: 34
Location: Germany

PostPosted: Mon 13 Jul 2015, 06:47    Post subject:  Works a charm in Tahrpup 6.0.3
Subject description: with a few modifications
 

I've used this code to get my startup sound running in Tahrpup 6.0.3 with the following setup:

* I reduced the code and found that this code was absolutely sufficient:
Code:
    aplay /usr/share/audio/2barks.au &
#replace the path with the one to the audio file you wish to play

* I took an executable from /usr/sbin (I used the one called "quicksetup") and opened it as text (with geany).
* I replaced all the content with the code from this page and saved the file as "zstartup-sound" (the z is to make it start up after everything else has loaded)
* Now it should show up black in /usr/sbin. To make it green, i.e. executable, I right clicked and changed the user rights to executable and searchable (a+x)
* Now you should be able to click it and hear the sound you put in the code
* To put it into persistent auto start I used the "Startup Control" GUI which you find in the Menu under Setup - add a new app here i.e. zstartup-sound and you're done.
* reboot and test Smile

I hope that helps some people. Enjoy Smile

_________________
Acer TravelMate 220 Intel Celeron CPU 1333MHz 739 MB RAM
Tahrpup 6.0.2 frugal folder Linux Kernel: 4.0.4 (i686) PAE PUPMODE=12
Belkin Surf Micro Wireless Adapter [Realtek RTL8188CUS] driver: rtl8192cu
Back to top
View user's profile Send private message 
flyp22


Joined: 08 Jul 2015
Posts: 34
Location: Germany

PostPosted: Mon 13 Jul 2015, 09:22    Post subject:  Shutdown sounds for Tahrpup 6.0.3  

For shutdown sounds its just as easy. Just add this code line at the beginning of the usr/bin/wmpoweroff and/or wmreboot script using your favourite text editor:

Code:
   aplay /usr/share/audio/2barks.au &
#replace the path with the one to the audio file you wish to play


Don't place it too far down in the script or the sound may be cut off by the shutdown process.

Enjoy Cool

_________________
Acer TravelMate 220 Intel Celeron CPU 1333MHz 739 MB RAM
Tahrpup 6.0.2 frugal folder Linux Kernel: 4.0.4 (i686) PAE PUPMODE=12
Belkin Surf Micro Wireless Adapter [Realtek RTL8188CUS] driver: rtl8192cu
Back to top
View user's profile Send private message 
Display posts from previous:   Sort by:   
Page 1 of 1 [10 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.0633s ][ Queries: 12 (0.0093s) ][ GZIP on ]