Thread: startup scripts
hi,
first off new these forums, , new ubuntu / linux. have followed forums , setup system, want create script when computer first starts copy file (playlist or presentation) , overwrite old file, play it.
i've done in windows, lost in os.
direct me information can have script run on startup please.
welcome forums!
stay calm , follow instructions
know how create script? if no, open 'text editor' (called gedit) , start new document with
as first line. then, after 1st line, can place commands.code:#!/bin/bash
can use command 'cp' replace old file (which replaced no problem, not prompt if file exists).
can open playlist want play vlc (or other player prefer) after timeout (10-15 seconds let system load has load).
so, script should go this:
now, after writing above text editor gedit, save file preferable location (most users tend place scripts under ~/documents or under ~/bin). easier distinguish shell script give extension .sh (example: launch_playlist.sh).code:#!/bin/bash cp ~/playlist_new ~/playlist_old #replace old playlist new, '~' stands /home/yourusername sleep 15 #sleep 15 seconds vlc ~/playlist_old #launch favorite media player selected playlist!
after saving file, right click on it, go properties->permissions , tick 'allow executing file program'.
done script. in order have running on startup need simple: create launcher , place appropriate directory.
head ~/.config/autostart/ if 'autostart' directory doesn't exist, create it.
then, create there file named anythingyouwant.desktop below contents:
edit above fields match needs , done!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
Forum The Ubuntu Forum Community Ubuntu Official Flavours Support Desktop Environments [ubuntu] startup scripts
Ubuntu
Comments
Post a Comment