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

New to Puppy and have questions? Start here

Moderator: Forum moderators

Post Reply
TIFTAF
Posts: 23
Joined: Fri Oct 16, 2020 2:58 am

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

Post 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

User avatar
taersh
Posts: 951
Joined: Tue Jul 07, 2020 11:13 pm
Location: Germany
Has thanked: 53 times
Been thanked: 119 times

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

Post 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?

My Music:
https://soundcloud.com/user-633698367
Using my own build of Bionic64
The far-left is as fascist as the far-right is!

User avatar
mikewalsh
Moderator
Posts: 5582
Joined: Tue Dec 03, 2019 1:40 pm
Location: King's Lynn, UK
Has thanked: 570 times
Been thanked: 1684 times

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

Post 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. ;)

Puppy "stuff" ~ MORE Puppy "stuff" ~ ....and MORE! :D
_______________________________________________________

Image

User avatar
bigpup
Moderator
Posts: 6277
Joined: Tue Jul 14, 2020 11:19 pm
Location: Earth, South Eastern U.S.
Has thanked: 734 times
Been thanked: 1295 times

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

Post 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 216 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.

Forum Global Moderator
The things you do not tell us, are usually the clue to fixing the problem.
When I was a kid, I wanted to be older.
This is not what I expected :o

TIFTAF
Posts: 23
Joined: Fri Oct 16, 2020 2:58 am

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

Post 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

Feek
Posts: 394
Joined: Sun Oct 18, 2020 8:48 am
Location: cze
Has thanked: 44 times
Been thanked: 86 times

Re: start-up sound

Post 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

User avatar
mikewalsh
Moderator
Posts: 5582
Joined: Tue Dec 03, 2019 1:40 pm
Location: King's Lynn, UK
Has thanked: 570 times
Been thanked: 1684 times

Re: start-up sound

Post 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. ;)

Puppy "stuff" ~ MORE Puppy "stuff" ~ ....and MORE! :D
_______________________________________________________

Image

Post Reply

Return to “Beginners Help”