I want to create a script which will run on startup. So I plan on putting it in System>Preferences>Startup Applications.
The aim of this script is to start up a media player and then start up the wminput service so I can connect my Wiimote. The call to wminput should be in an infinite loop so that if wminput loses connection, it will restart so that I can reconnect.
In this I have two things. I want the script to call the media player to start it, then I want the call to wminput to be a blocking call so that in the while loop it waits for this to return before trying to start it. I don't know if calls to scripts and other programs are blocking calls or not.
I was hoping to have something like:
With the blocking problem, if all calls are non blocking then I could end up running infinite(ish) instances of wminput, and if they are blocking then I will only run my player and not get to register the remote.Code:# Start media player ./mediaplayer # keep trying to register for wiimote while true; do wminput -c ir_ptr done
Also, by adding scripts to startup applications, do they run sequencially, because my while loop could hold it in there.
I did a quick bit of googling and couldn't find anything obvious, plus I am quite new to bash.
Any help, tips, web links etc would be of great help.