Assuming the default configuration, xdpyinfo on "original" would show a display of ":0.0", e.g.
xdpyinfo | grep name
If your DISPLAY environment variable on "x2go" is ":1.0" then it should be so.
From a terminal on "x2go" Try to find the window-id:
DISPLAY=:0.0 xwininfo -root -tree | grep Writer
It's possible that access control is set up so that it will not work, but I think it should if you are the same userid on the same host (i.e. access to ~/.Xauthority). Check "xauth list" output if no access.
If it works, then use your favourite tool to control it. Add "-int" to the xwininfo above to print the windowid in decimal if your tool requires it that way, xdotool does not:
export DISPLAY=:0.0
xdotool windowactivate 0x15a18918
xdotool windowfocus 0x15a18918
xdotool key "ctrl+s"
xdotool key "ctrl+q"
or you might have better luck with these instead of "ctrl+s"/"ctrl+q"
xdotool key "meta+f" "s"
xdotool key "meta+f" "c"
xdotool key "meta+f" "x"
You might need "alt+" instead of "meta+", I have non-standard meta/alt/super mappings. meta works for me, tested using an Xnest. I'm assuming unaltered English menu layout and accelerators.
It's possible there's a popup in your way, in which case it's worth trying:
xdotool key "Escape"
a few times, then retrying the save & close. Remember xdotool is fussy about exact case of "key" names.
You should be able to try all this by starting libreoffice on x2go, and NOT modifying your DISPLAY.
You should save the commands to a shell script file so that focus changes don't mess you up.
lsof should show file no longer open if it worked :-)
DISPLAY=:0
(or whatever display your other account happens to be on) and then launch the server and get to it from the client. But that might be excessive. LibreOffice might have a message protocol - I'm not terribly familiar with it because I use either Google Docs or plain text files in Vim (including LaTex)... – Wayne Werner Dec 13 '12 at 18:00DISPLAY:1
then start any X program (xeyes for test) and would run under the VNC. Same applies to remote vncservers. SSH into machine then simple run export DISPLAY:1 before you use. – m3nda May 22 '15 at 5:13