4

I've gone abroad, leaving LibreOffice Writer open with some file I edited. Unfortunately - I forgot to press Save! Now, I have SSH access to that machine, but - how can I make LibreOffice save the file without me using the GUI? Can I signal it somehow?

I'm using Debian GNU/Linux Stretch.

einpoklum
  • 8,783
  • 20
  • 84
  • 153
  • have a look at this question: http://unix.stackexchange.com/questions/55310/how-to-attach-to-remote-machines-local-display-session-over-ssh - You might be able to get a remote graphical view of the existing desktop session using vnc and x server – GregHNZ Jul 19 '16 at 08:39

1 Answers1

6

I did not test your setup, but this worked for me from a terminal:

xdotool search --name Untitled key ctrl+s
xdotool search --name Untitled key ctrl+q

"Untitled 1" was the name of the document in my test. Ctrl+s saves, and Ctrl+q quits.

See https://unix.stackexchange.com/questions/87831/how-to-send-keystrokes-f5-from-terminal-to-a-process.

Alternatively, if you force kill the process, next time it should open in recover mode. Probably it will be able to recover most or all of the changes.

Jim K
  • 3,839
  • 1
  • 8
  • 20
  • Does this rely on the application and document being what is in focus on that machine? – fixer1234 Jul 19 '16 at 17:02
  • No, LibreOffice was never in the foreground during my test. A different window was active instead. – Jim K Jul 19 '16 at 18:16
  • So, I tried this, and while I did manage to find the window with xdotool search --name "the_filename.odt" and get a number - appending "key ctrl+s" did not do anything. – einpoklum Apr 06 '23 at 15:18