Skip to content

Instantly share code, notes, and snippets.

@windyweather
Created April 10, 2020 04:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save windyweather/cb5375317d7880c80c18ae3d42173f6f to your computer and use it in GitHub Desktop.
Save windyweather/cb5375317d7880c80c18ae3d42173f6f to your computer and use it in GitHub Desktop.
Example Bash Script that will run a series of LibreOffice Impress slideshows in an infinite loop.
#!/bin/bash
# wait for the show named soffice to finish
# keep clicking the mouse until it ends.
function waitforshow {
sleep 5
echo "Clicking the mouse and waiting for show to end. Ctrl/C to Exit"
while pgrep soffice > /dev/null 2>&1
do
echo "Click"
xdotool click 1
sleep 5
done
echo "show has completed"
}
# Launch a slideshow by passing it a filepath to the impress file
# wait on the show to finish and then return.
function launch {
soffice --impress --show $1 &
waitforshow
}
# Loop forever showing these slideshows
while :
do
echo "Start Impress on a show and let it go"
launch ShowTestOne.odp
launch ShowTestTwo.odp
launch ShowTestThree.odp
echo "Loop back to start all the shows again"
done
# never get here
@windyweather
Copy link
Author

Need to make sure that the file names are script friendly. No dashes, no ampersands, no spaces. Even quotes don't help to avoid problems if these characters are used in the filenames. Put the script in the same directory as the scripts to make it easier to set up the script. Of course you need to set the script file properties / permissions to include Allow Execute. And of course you need to launch the script with:
./scriptname.bash so it will launch correctly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment