Ok so it appears you are running mopidy with a systemd service (you can see that with all the systemctl
commands in the install script.
I thing the easiest way to go would be to create a custom service that would sleep for a while, then add a song and trigger playback. For this you need :
- install mopidy-mpd, and mpc
- Configure mpc to connect it with mopidy (i guess)
- Write and save a script like
#! /bin/bash
sleep 10
mpc add "some song"
mpc play
- Make the script executable:
chmod +x /path/to/script.sh
- Write a systemd service file like
[Service]
Type=simple
RemainAfterExit=no
ExecStart=/path/to/script.sh
- Save the service file in
/etc/systemd/system/autoplay.service
- You can test if the service works using
systemctl start autoplay
, which should trigger the song after 10 seconds (addapt to your needs) - To enable the script and run it at each startup, run
systemctl enable autoplay
in a terminal.
I might have forgotten a step or made some mistakes, but that should be the general idea.