Created
April 10, 2020 04:03
-
-
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.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.