Thank you for your donation!


Cloudsmith graciously provides open-source package management and distribution for our project.


Force music play on turn on
#9
For those who might be in a similar situation, I manage to find a solution.

1) created a file (with nano) named start_music.sh

2) edited the file with these inputs:

sleep 10  # Wait for 10 seconds after aplying this
mpc clear  # Clear the current playlist
mpc load 'Default Playlist'  # Load the playlist named 'Default Playlist'
mpc volume 50
mpc play  # Start playing the music
sleep 1  # Wait for 1 second
mpc volume 100
mpc stop  # Stop the playback after 1 second


3) changed permission using

chmod +x start_music.sh

4) executed 

crontab -e

5) added the following line

@reboot sleep 30 && /path/to/your/script/start_music.sh

6) save and exit

(Make sure to replace /path/to/your/script/ with the actual path where you saved your script.Save the crontab file and exit the editor)

done Smile
Reply


Messages In This Thread
Force music play on turn on - by tiago.trindade - 01-06-2024, 07:41 AM
RE: Force music play on turn on - by Tim Curtis - 01-06-2024, 12:04 PM
RE: Force music play on turn on - by Nutul - 01-06-2024, 01:20 PM
RE: Force music play on turn on - by Tim Curtis - 01-06-2024, 06:37 PM
RE: Force music play on turn on - by Nutul - 01-07-2024, 06:27 PM
RE: Force music play on turn on - by tiago.trindade - 05-07-2024, 05:39 PM

Forum Jump: