redhog / InfiniteGlass

Window manager with infinite desktop, infinite zoom and infinite window resolution
https://redhog.github.io/InfiniteGlass/
GNU General Public License v3.0
35 stars 5 forks source link

Integration: LibreOffice #27

Open redhog opened 4 years ago

redhog commented 4 years ago

Figure out a way to have LibreOffice save the list of currently open files on exit.

redhog commented 4 years ago

@BackOrder do you have any experience scripting LibreOffice?

IanTrudel commented 4 years ago

Take a look at this: https://ask.libreoffice.org/en/question/78511/macro-code-to-switch-between-open-writer-documents/

redhog commented 4 years ago

Ah that's a good start... So how do I run code at startup and at shutdown? And is it possible to call python code (which in turn can call smlib)?

IanTrudel commented 4 years ago

https://superuser.com/questions/1135850/how-do-i-run-a-libreoffice-macro-from-the-command-line-without-the-gui https://ask.libreoffice.org/en/question/145481/struggling-to-auto-run-a-macro/

There is a problem though. What happens when LibreOffice crashes? It won't be running the shutdown script.

redhog commented 4 years ago

Hm, good question. I guess you could have it save state every now and then? What I'm thinking is run a script at startup that registers as an SMLib client, and on the SMLib save message, goes through the list of open windows and saves them, and saves that list, and generates a RestartCommand matching the saved list...

IanTrudel commented 4 years ago

LibreOffice has UNO to communicate with different programming language. The SDK is available for Python. That would be more in line with what you want to do.

https://help.libreoffice.org/6.3/en-US/text/sbasic/python/python_programming.html

https://api.libreoffice.org/examples/examples.html

https://wiki.openoffice.org/wiki/Documentation/DevGuide/ProUNO/Starting_OpenOffice.org_in_Listening_Mode

https://pypi.org/project/unotools/

redhog commented 4 years ago

Moved the initial zoom problem to https://github.com/redhog/InfiniteGlass/issues/11