Welcome to the forums!
Stay calm and follow my instructions
Do you know how to create your script? If no, then open the 'Text Editor' (called Gedit) and start a new document with
as the first line. Then, after the 1st line, you can place your commands.
You can use the command 'cp' so as to replace the old file (which will be replaced with no problem, it will not prompt if the file already exists).
Then you can open the playlist you want to play with VLC (or any other player you prefer) after a certain timeout (10-15 seconds so as to let the system load anything it has to load).
So, the script should go something like this:
Code:
#!/bin/bash
cp ~/playlist_new ~/playlist_old #replace the old playlist with the new, the '~' stands for /home/yourusername
sleep 15 #sleep 15 seconds
vlc ~/playlist_old #launch your favorite media player with the selected playlist!
Now, after writing the above to a text editor like Gedit, save your file to your preferable location (most users tend to place their scripts under ~/Documents or under ~/bin). So as to be easier for you to distinguish that this is a shell script give it the extension .sh (example: launch_playlist.sh).
After saving the file, right click on it, go to Properties->Permissions and tick the 'Allow executing file as program'.
You are almost done with your script. In order to have it running on startup you need to do something simple: To create a launcher and place it to the appropriate directory.
Head to ~/.config/autostart/ If the 'autostart' directory doesn't exist, then create it.
Then, create there a file named anythingyouwant.desktop with the below contents:
Code:
[Desktop Entry]
Type=Application
Exec=/home/alex/Documents/myscript.sh
Terminal=False
Hidden=false
NoDisplay=false
X-GNOME-Autostart-enabled=true
Name[en_US]=Copy playlist
Name=Copy playlist
Edit the above fields so as to match your needs and you are done!
Bookmarks