Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Example Bash Script that will run a series of LibreOffice Impress slideshows in an infinite loop.
# 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
echo "Click"
xdotool click 1
sleep 5
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 &
# Loop forever showing these slideshows
while :
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"
# never get here
Copy link

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