EDIT: if troubleshooting is not a good forum for this, please feel free to move. Just wasn't sure what it would fall under.
This is what I would like to do.
Have a script that starts automatically on boot.
Opens the most recently modified presentation (in presentation mode with libreoffice impress - possibly needs to be read only mode also so the file can continue to be updated from another machine) in a CIFS mounted smb location.
Scans the same folder every x minutes for updates to files.
If a newer file is found, close (either gracefully or kill) libreoffice impress process and reopen with newer file.
Rinse and repeat.
This is what I have so far;
watch.sh
Code: Select all
#This script scans '/mnt/presentations' every two mins for a more newer file. If it finds one, it will run restartPresentation.sh (at least I hope it does. It seems to work but sometimes it launches the script twice or more times)
while true
do
touch ./lastwatch
sleep 120
find /mnt/presentations -cnewer ./lastwatch -exec ~/restartPresentation.sh \;
done
Code: Select all
#Kill libreoffice processes
killall oosplash
killall soffice.bin
#remove lockfiles (not needed if I can get read only & presentation mode working)
rm -r /mnt/presentations/.~lock.*
#open LibreOffice. --show for presentation mode. --view for readonly. But these commands don't work together.
libreoffice --show --view `ls -tr /mnt/presentations/*.pptx | tail -1`* Can't get the presentation to open in presentation mode AND read only (causes problems with recovery of docs on restart when opened in edit mode)
* Lots more problems, like the application not ending gracefully. Application not ending at all sometimes. Bash windows never ending, cause new scripts to stall until intervened with.
I've also done more testing with other stuff but my brain is melted right this moment and I can't for the life of me think what else I have done.
My scripting leaves a lot to be desired. But if someone could help me out with this, I would really appreciate it. Feel free to merge the scripts. There is no reason for them to be seperate, that's just where my rabbit hole lead me.
Thanks in advance!