Audio playback at a certain time (cron)

As for cron, while there are cron daemons available, you can use system timers to fire something at a certain time.

Of course, it’s more complex and nedlessly convoluted because it’s systemd, but you don’t need to install any thirt party software to do it.

The quick, non-reboot-surviving way to do it would be

$ systemd-run --user --on-calendar 'hourly' /bin/sh -c "/usr/bin/paplay /home/user/beep.wav"

If you’re satisifed, you can save the resulting unit files like so:

$ systemctl --user cat run-<UUID>.timer | grep -v ^# > ~/.config/systemd/user/hourly-bing.timer
$ systemctl --user cat run-<UUID>.service | grep -v ^# > ~/.config/systemd/user/hourly-bing.service
4 Likes