2

i am searching for a solution how to echo a keydown over SSH to a running GUI (based on debian).

like VNC or Teamviewer but only command line based.

Mike
  • 123
  • 1
    Explain more. What have you tried. What is the recipient of the keydown. What exactly are you trying to achieve? Why a keydown to a GUI, is there something you cannot do from the commandline? – grebneke Feb 06 '14 at 20:50
  • for example: openoffice impress with an ppt file is running and to start it, normaly you can press the "F5" key on the keyboard. but when you only have SSH access, i want to send a 'fake' keypress to the client where impress is running to start the presentation. – Mike Feb 06 '14 at 20:56

1 Answers1

4

Use xdotool to find the window and send a key event. Example, assuming 'OpenOffice Impress' is in the titlebar of that application, and that it is running on $DISPLAY :0

$ ssh remote-computer
$ export DISPLAY=:0
$ xdotool key --window $(xdotool search --name 'OpenOffice Impress')  F5
grebneke
  • 4,671
  • Invalid MIT-MAGIC-COOKIE-1 key – aaa Jun 16 '22 at 14:18
  • @aaa error about MIT-MAGIC-COOKIE-1 is not related to xdotool. See https://unix.stackexchange.com/questions/12755/how-to-forward-x-over-ssh-to-run-graphics-applications-remotely for how to run X applications with remote forwarding – grebneke Jun 17 '22 at 17:23