LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   newbie: sending keystrokes over ssh (https://www.linuxquestions.org/questions/linux-newbie-8/newbie-sending-keystrokes-over-ssh-4175527113/)

tonj 12-02-2014 02:29 PM

newbie: sending keystrokes over ssh
 
I have a centos 6 desktop machine that is playing a video in firefox. If I tap the keyboard space bar while it's playing I can pause and continue the video at will. The video will also pause and continue with a mouse click if the pointer is on the image.
However I need to simulate this key tap from another machine using a command in an ssh terminal. Is it possible to control the video this way from another machine?
I've tried xdotool but I can't get it to work, it doesn't do anything via an ssh console, maybe I'm doing something wrong but I can't get any support on it.
Is there any other method whereby I could send keystroke commands to the machine playing the video and thereby control the playback of the video? thanks for any help.

evo2 12-02-2014 10:19 PM

Hi,

it sounds like you are looking for a firefox remote control AddOn. Have you tried searching for that?

Evo2.

tonj 12-03-2014 03:27 AM

no, it's not specifically firefox I want to control. I could play a video in vlc, or in mplayer, or in another browser so it's a global kind of control I need.

evo2 12-03-2014 09:07 PM

Hi,

so you don't want to just control firefox, but to control your whole xsession? If so I guess you need some sort of remote desktop. However this would be rather clunky. Perhaps if you could give the bigger picture about what you are trying to achieve someone might be able to suggest an alternative approach.

Evo2.

evo2 12-03-2014 09:32 PM

Hi,

it just occurred to me that you might be able to do what you want with xdotool. Should be available for most distros - check your package manager.

Evo2.

tonj 12-04-2014 04:10 AM

evo2 I already said in my OP I've tried xdotool but I can't get it to work and I can't find any support on it.

evo2 12-04-2014 07:19 PM

Hi,
Quote:

Originally Posted by tonj (Post 5279271)
I already said in my OP I've tried xdotool

sorry I missed that.
Quote:

Originally Posted by tonj (Post 5279271)
but I can't get it to work and I can't find any support on it.

Really? What exactly did you try? What happened? Did you set your DISPLAY variable?
Eg.
Code:

export DISPLAY=:0.0
Evo2.

tonj 12-05-2014 01:17 AM

evo2 thankyou for that tip, export DISPLAY=:0.0 did the trick and now xdotool is typing things into a terminal window over remote ssh. I'm still a fumbling newbie with it but at least I have some action now.


All times are GMT -5. The time now is 12:36 AM.