How to write script to run playlist at boot

Soldato
Joined
1 Apr 2004
Posts
2,981
Location
Herts, UK
I am a complete noob to Linux so scripting is a bit beyond my knowledge at the moment.
I am trying to build a PC that will automatically run a playlist (of videos or music) at startup, a bit like an advert player.
I am trying XUbuntu with SMplayer, and I have created a playlist with some videos, which I can run fullscreen when double clicking the playlist icon.

Could someone help me with creating a script that I could run at startup that will automatically load the playlist and start playing?
Is it as simple as just having something like "smplayer playlist.m3u -fullscreen"?
 
Yes, it is pretty much that simple.

Make a script file myscript with a text editor and put:
Code:
#!/bin/bash
smplayer playlist.m3u -fullscreen

Now make the script executable, and run: chmod +x myscript, make sure playlist.m3u is in the same directory as the script, and now when running myscript with ./myscript it should do what you want.

Running that script at startup will depend on your distro, ubuntu probably has a nice gui somewhere :p But you probably want to put it in Gnome or KDE startup scripts rather than your OS.
 
Thanks for that, I'll give that a go, I have found lots of sites with instructions on making scripts run on startup, it was just the actual script I had no clue about.
 
Back
Top Bottom