I recently had my graphics driver crash, and cannot interact with my computer locally (I can't even switch out to a different virtual terminal). However, I can log in to the system via ssh, so I'm looking through the list of running processes and trying to figure out what work I can somehow save and what I can't. I have at least one document open in LibreOffice, and while I *think* everything's been saved, I can't verify it visually, and it would be great to have a means of forcing open documents to be saved to disk rather than having to rely on being able to recover them after terminating the process. On platforms that support remote text logins, I propose an option that might be described in the man page something like the following: --graphics-hosed For use in emergencies when the system graphics stack is hung or otherwise unusable. Implies --headless and --invisible. The application ignores any GUI environment and signals non-headless LibreOffice processes started by the same user to save any open files and exit.
You can connect to a running LibreOffice process with Python, but the process has to be start with --accept parameter. This question is about the topic of saving an open file, but unfortunately it does not have a solution (should be possible, though): https://ask.libreoffice.org/en/question/179803/python-script-connect-to-writer-document/ An example of using --accept: https://ask.libreoffice.org/en/question/201364/uno-choosing-between-running-office-instances/