Page 1 of 1

How to link the tray-battery-icon to a sound wafe

Posted: Thu Dec 03, 2020 10:54 pm
by TIFTAF

Hi all.
I would like to know how to make a link between the tray-battery-icon and a sound-wave when the battery-level reaches 3% of full capacity.

The battery icon starts to blink at a low battery level and ideally the sound wave would play at the same moment.
Thank you for your help


Re: How to link the tray-battery-icon to a sound wafe

Posted: Thu Dec 03, 2020 11:20 pm
by taersh

If that tray-battery-icon is a binary-program, you would need to modify the C source code and compile it again after the modifications have been added. Though, I don't know if it's a binary or a script. Even a script would need to be modified to achieve this.

Can you find out, if it's a binary or script?


Re: How to link the tray-battery-icon to a sound wafe

Posted: Thu Dec 03, 2020 11:50 pm
by mikewalsh

I agree with Rainer. If it's a binary, you'll have problems.

If, however, it's a script, you could make use of this script I use to play a 'start-up' sound when Puppy boots to desktop.....along the same lines as the 'jingle' older versions of Windows used to play at boot (I can't speak from experience for anything newer than Win 7):-

Code: Select all

#!/bin/sh
amixer -c 0 -- sset Master playback -36dB
mplayer /usr/share/audio/logon-1.mp3 &

You'll need mplayer installed for it to work correctly, though this is already present in some Puppies. Trial and error using 'alsamixer' in the terminal will let you adjust the volume level (the '-36db') to a suitable level.....you may want this higher. Where the example gives 'logon-1.mp3' as the sound file, you can of course use any sound file as your warning; make sure this goes into /usr/share/audio so the script will find it.

You can find any number of sites online where you can download free sound clips. Search for one that gives the kind of warning sound you want. The 'startup sound' I use is this one:-

.....though you'll doubtless want something different.

We DO need to know if it's a script or not. If so, we'll then need to figure out how to either trigger this as a separate script, or a way to insert it into the existing script to give the effect you're after. It can be set to repeat, as well, if you want. Rainer is good at this kind of thing, though I can probably help if the script isn't too complex..!

Mike. ;)


Re: How to link the tray-battery-icon to a sound wafe

Posted: Fri Dec 04, 2020 2:13 am
by bigpup

If you had told us which exact Puppy version you are using! :roll:
We would know for sure which exact battery level program is being used.

OK I will guess!
It is Qbat

Right click on the tray battery icon.
Choose settings.
Set it up like this image.

Screenshot.jpg
Screenshot.jpg (32.78 KiB) Viewed 357 times

.
Execute /usr/bin/lowbat should be giving you 2 barks.
You can open lowbat in a text editor and change the sound file it uses.

I strongly suggest you set the warning level to 40%.
Any lower than that, without hooking to a charger, is considered affecting the possible life span of the battery.
The idea is keeping from having to do a full charge cycle, which does have a limited number of times.


Re: How to link the tray-battery-icon to a sound wafe

Posted: Fri Dec 04, 2020 11:18 pm
by TIFTAF

Hi all.
In regard to " How to link the tray-battery-icon to a sound wave "
@taersh
@mikewalsh and
@bigpup
Thank you for your answers. I will try and work what it is and report back to you.
Ulrich


Re: start-up sound

Posted: Sun Dec 06, 2020 2:27 pm
by Feek
mikewalsh wrote: Thu Dec 03, 2020 11:50 pm

If, however, it's a script, you could make use of this script I use to play a 'start-up' sound when Puppy boots to desktop.....

I improved my Puppy with a start-up sound. Love it.
Mike Walsh, thanks for inspiration and for the script. :thumbup:
Feek


Re: start-up sound

Posted: Sun Dec 06, 2020 8:16 pm
by mikewalsh
Feek wrote: Sun Dec 06, 2020 2:27 pm
mikewalsh wrote: Thu Dec 03, 2020 11:50 pm

If, however, it's a script, you could make use of this script I use to play a 'start-up' sound when Puppy boots to desktop.....

I improved my Puppy with a start-up sound. Love it.
Mike Walsh, thanks for inspiration and for the script. :thumbup:
Feek

You're very welcome. Have fun with it!

Mike. ;)