You are not logged in.
I used to use an app called Alarm-clock-applet, or something like that. It is not available in the Devuan 3 repos. Can anybody suggest something like it? I just want a simple timer to set that will ring/play an alarm alerting me that time's up. I usually use it when I set water to boil on the stove-top (one time I forgot and boiled away all the water, yikes).
On a related question, I see one potential replacement, gnome-clocks, however it needs avahi-daemon installed. On my list of "things to do" after a fresh OS install is to delete avahi-daemon. I don't have why, just delete it. Is there any reason why having this avahi-daemon is a bad idea? There must have been a reason why I wanted/needed it deleted.
Offline
sleep 300 ; mplayer loud-song.ogg
works for me
Offline
I assume this is a terminal command? What does "sleep" do? I don't want my computer to go to sleep.
Offline
`sleep 300` means to delay running the following command (=mplayer...), for 300 seconds (= 5 mins.)
not suspend/hibernate the whole computer...
p.s. not using alarm clocks, so i don't have an alternative. still boil the water away occasionally
Offline
I just want a simple timer
KTeaTime is in Devuan 3 repos: https://apps.kde.org/kteatime/
Offline
While sleep is fine and super easy to remember for boiling a kettle, it's not so good as an alarm. For that the "at" command is handy.
at -t ccyymmddhhmm.ss # cc=century yy=year mm=month dd=day hh=hour mm=minute .ss=seconds (note the dot!) or just don't bother with .ss
Set the time to run
at -t 202201192359
press return
Command to run e.g.
ogg123 ~/Music/Rock/loud-song.ogg
press return
press ctrl D
That's it. see "man at" for more options like
Boil an egg
at now + 3 minutes
press "return"
ogg123 ~/path/to/loud-song.ogg
press "return" then press "ctrl D"
I believe the return after ogg123 ~/path/to/loud-song.ogg is not strictly necessary but I've found it more intuitive and it doesn't hurt. In other words muscle memory. I keep doing it and it works fine! :-$
To switch off the alarm
killall ogg123
Morning alarm clock
at 7:30 AM tomorrow
press "return"
ogg123 ~/Music/Rock/loud-song.ogg
press "return" then press "ctrl D"
Note make sure your volume is up!
Offline
Here's a (very) simple script for the timer (replace /path/to/sound/file with the actual full path to the sound file you want to use as the alert):
#!/bin/sh
echo "Hello $USER, please enter a countdown time
Add m for minutes and h for hours, seconds is assumed
For example 1h 1m 1 would set the time to 1 hour, 1 minute and 1 second"
read -r time
# shellcheck disable=2086 # word splitting is needed here
sleep $time
aplay /path/to/sound/file
^ Save that as timer then
chmod +x timer
sudo mv timer /usr/local/bin/
Then make a menu entry for it:
[Desktop Entry]
Type=Application
Name=Timer
Generic=Timer
Comment=HoaS' simple timer script
Exec=timer
Terminal=true
Categories=Utility;ConsoleOnly;
Keywords=utility;timer
^ Save that as timer.desktop then
sudo mkdir -p /usr/local/share/applications
sudo mv timer.desktop /usr/local/share/applications
Now log out and back in again and the "Timer" application should be available under "Utilities".
EDIT: the alsa-utils package supplies the aplay command so you'll need to install that along with any required CODECs for the sound file of choice.
Last edited by Head_on_a_Stick (2022-01-19 16:21:03)
Brianna Ghey — Rest In Power
Offline
Thanks to all who answered. I have a question for using both Kelsoo's and HoaS's answer:
For Kelsoo's simple command: sleep 300 ; mplayer loud-song.ogg
is there a way to set it so that mplayer continues to play the sound file, until I tell it to stop?
For HoaS's script, same question.
Offline
Both versions will play the sound file until it ends (or until the script/command is interrupted with <ctrl>+c).
Brianna Ghey — Rest In Power
Offline
Both versions will play the sound file until it ends (or until the script/command is interrupted with <ctrl>+c).
I'm sorry, I wasn't clear. What I want is for it to repeat the sound file until I tell it to stop repeating.
Offline
In which case:
#!/bin/sh
echo "Hello $USER, please enter a countdown time
Add m for minutes and h for hours, seconds is assumed
For example 1h 1m 1 would set the time to 1 hour, 1 minute and 1 second"
read -r time
# shellcheck disable=2086 # word splitting is needed here
sleep $time
while aplay /path/to/sound/file ; do
:
done
Or
sleep 300 ; while mplayer loud-song.ogg ; do : ; done
Last edited by Head_on_a_Stick (2022-01-19 19:30:25)
Brianna Ghey — Rest In Power
Offline
Once again, HoaS for the win! Thanks.
Offline
alternative (since mplayer supports it...) :
sleep 300 ; mplayer -loop 0 loud-song.ogg
Offline
^
In a similar fashion with ogg123 you can use the -Z option
-Z, --random
Play files in pseudo-random order forever.
ogg123 -Z ~/path/to/loud-song.ogg
The obvious thing to note if using as an alarm is make sure you only have loud files in the directory.
Incidentally I was woken at 7;30 AM this morning with this blasting in my ears
https://derryth.com/s/free-software-song-best-version
Hence, I can recommend reading the man page at a sane time of day! If using the at command you can check the queue with
atq
and clear items in it with atrm queue number
atrm 1 2 4 8
:-)
Offline