Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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

windyweather commented Apr 10, 2020

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