Page 1 of 1
Use pschedule for a continuous sound
Posted: Wed Jan 12, 2022 6:49 pm
by don570
I tested pschedule in fatdog64 812 to see if it could schedule an alert with a continuous sound.
Exiting will shut off sound.
I noticed that crond service is not turned on by default, so that needs to done.
Then launch pschedule and click on 'Add'.
Fill in time and the command.
Code: Select all
#!/bin/sh
# continuous sound is heard until window is closed
echo '
#!/bin/sh
while [ 1 ] ; do aplay /usr/share/audio/2barks.au ; done 2>/dev/null
' >/usr/sbin/continous_script.sh
#permissions must be given to /usr/sbin/continous_script.sh
chmod 755 /usr/sbin/continous_script.sh
/usr/sbin/continous_script.sh &
pid=$!
# when gtkdialog window is closed -- kill is executed
export QUIT='<window title="Continuous Sound" icon-name="ptiming">
<vbox>
<hbox homogeneous="true"><text><label>"'$(date)'"</label></text></hbox>
<hbox homogeneous="true"><text><label>"Exit to kill sound"</label></text></hbox>
<hbox>
<button>
<label>"Exit"</label>
<action type="exit">CLOSE</action>
</button>
</hbox>
</vbox>
</window>
'
gtkdialog -p QUIT -c
kill -9 $pid 2>/dev/null
Here is the compressed script --> continuous_sound.sh
You can decompress it and place it anywhere (such as /root)
Make sure it can be executed.
____________________________________
I looked in /var to see what was in the crontab file
- screenshot-pschedule.jpg (33.16 KiB) Viewed 705 times
__________________________________________
Re: Use pschedule for a continuous sound
Posted: Thu Jan 13, 2022 1:03 am
by Clarity
I foresee many useful needs for this utility. I am old, and little "nudges" from utilities like this is EXTREMELY helpful. Thanks Don for bringing this to us!
I ask:
Should this utility have a front-end for setup of media playback selection or maybe a 'nudge.conf' file to reference media/other variable needs for the script?
In any event, thanks, MUCHLY.
Re: Use pschedule for a continuous sound
Posted: Fri Jan 14, 2022 5:18 pm
by don570
setup of media playback selection
I chose aplay because it is in all linux distros.
You can install mpg123 app and switch to it by changing one line in script.
________________________________________
There is a more sophisticated alarm ---> ptmtimer 2.6
https://oldforum.puppylinux.com/viewtop ... 83#p978483
It searches for a media player.
______________________________________
Re: Use pschedule for a continuous sound
Posted: Sat Jan 15, 2022 5:39 am
by MochiMoppel
don570 wrote: ↑Wed Jan 12, 2022 6:49 pmCode: Select all
#!/bin/sh
# continuous sound is heard until window is closed
echo '
#!/bin/sh
while [ 1 ] ; do aplay /usr/share/audio/2barks.au ; done 2>/dev/null
' >/usr/sbin/continous_script.sh
#permissions must be given to /usr/sbin/continous_script.sh
chmod 755 /usr/sbin/continous_script.sh
/usr/sbin/continous_script.sh &
pid=$!
# when gtkdialog window is closed -- kill is executed
export QUIT='<window title="Continuous Sound" icon-name="ptiming">
<vbox>
<hbox homogeneous="true"><text><label>"'$(date)'"</label></text></hbox>
<hbox homogeneous="true"><text><label>"Exit to kill sound"</label></text></hbox>
<hbox>
<button>
<label>"Exit"</label>
<action type="exit">CLOSE</action>
</button>
</hbox>
</vbox>
</window>
'
gtkdialog -p QUIT -c
kill -9 $pid 2>/dev/null
You could avoid creating and killing continous_script.sh by running aplay directly from gtkdialog:
Code: Select all
#!/bin/sh
export QUIT='<window title="Continuous Sound" icon-name="ptiming">
<vbox>
<timer visible="false" interval="2">
<action>aplay -q /usr/share/audio/2barks.au</action>
</timer>
<hbox homogeneous="true"><text><label>"'$(date)'"</label></text></hbox>
<hbox homogeneous="true"><text><label>"Exit to kill sound"</label></text></hbox>
<hbox>
<button>
<label>"Exit"</label>
<action type="exit">CLOSE</action>
</button>
</hbox>
</vbox>
</window>
'
gtkdialog -p QUIT -c
timer widget
Posted: Sat Jan 15, 2022 4:53 pm
by don570
I didn't know about timer widget.
https://github-wiki-see.page/m/step-/gt ... wiki/timer
______________________________________
Re: Use pschedule for a continuous sound
Posted: Sun Jan 16, 2022 2:14 am
by user1111
No 'at' command available in fatdog, busybox or gslapt !!!
while [ $(date +%I:%M) != "17:00" ]; do sleep 1; done