LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 12-02-2014, 02:29 PM   #1
tonj
Member
 
Registered: Sep 2008
Posts: 546

Rep: Reputation: 37
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.
 
Old 12-02-2014, 10:19 PM   #2
evo2
LQ Guru
 
Registered: Jan 2009
Location: Japan
Distribution: Mostly Debian and CentOS
Posts: 6,724

Rep: Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705
Hi,

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

Evo2.
 
Old 12-03-2014, 03:27 AM   #3
tonj
Member
 
Registered: Sep 2008
Posts: 546

Original Poster
Rep: Reputation: 37
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.
 
Old 12-03-2014, 09:07 PM   #4
evo2
LQ Guru
 
Registered: Jan 2009
Location: Japan
Distribution: Mostly Debian and CentOS
Posts: 6,724

Rep: Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705
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.
 
Old 12-03-2014, 09:32 PM   #5
evo2
LQ Guru
 
Registered: Jan 2009
Location: Japan
Distribution: Mostly Debian and CentOS
Posts: 6,724

Rep: Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705
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.
 
Old 12-04-2014, 04:10 AM   #6
tonj
Member
 
Registered: Sep 2008
Posts: 546

Original Poster
Rep: Reputation: 37
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.
 
Old 12-04-2014, 07:19 PM   #7
evo2
LQ Guru
 
Registered: Jan 2009
Location: Japan
Distribution: Mostly Debian and CentOS
Posts: 6,724

Rep: Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705
Hi,
Quote:
Originally Posted by tonj View Post
I already said in my OP I've tried xdotool
sorry I missed that.
Quote:
Originally Posted by tonj View Post
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.
 
Old 12-05-2014, 01:17 AM   #8
tonj
Member
 
Registered: Sep 2008
Posts: 546

Original Poster
Rep: Reputation: 37
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.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Sending Keystrokes through Shell Script Deepakp1387 Linux - Newbie 2 01-28-2013 09:16 AM
sending keystrokes pass Programming 4 08-19-2006 03:13 PM
Sending keystrokes to a gui lm317t Programming 3 10-11-2005 06:17 PM
Sending Keystrokes lm317t Linux - Software 0 10-10-2005 04:02 PM
Sending Keystrokes to a window seidren Programming 5 10-28-2003 06:24 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 06:20 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration