1

With a SSH connection I can open midori:

pi@raspberry$ DISPLAY=:0 midori http://www.google.com

Google loads up as normal

Q: How can I, from the terminal search for something whilst Google is loaded? And then enter 3rd result found? Also I would like to remotely enter (for example) my email, and enter my password and email address when I open gmail.com remotely?

How can I remotely enter these things (what I want to search, my email address, my password, etc)?

3kstc
  • 131
  • 1
  • 2
  • 10
  • 2
    How about using remote desktop ? :) – dhruvvyas90 Sep 09 '15 at 06:42
  • 2
    Yeah, i would use vnc for sure if you are trying to get to a more desktop/laptop feel. – Jonathan cartwright Sep 09 '15 at 08:05
  • @dastaan Didn't think of Remote Desktop - but here is an excellent reference for anyone else who would be keen on a Remote Desktop appraoch – 3kstc Sep 10 '15 at 00:10
  • @dastaan I would ideally like to mirror the raspberry pi onto my laptop - but what I can achieve currently is just tap into raspberry with xrdp and do stuff on the RPi with my laptop -but- the stuff I do doesn't get mirrored onto the screen the raspberry is connected to. How can I mirror what I do on my laptop to the screen the RPi is hooked up to? (Raspberry pi is hooked to 40" TV via HDMI) – 3kstc Sep 10 '15 at 00:26
  • Oh you can mirror the screen as well. Here is the link. :) http://raspberrypi.stackexchange.com/questions/9590/tightvncserver-show-the-same-screen-on-hdmi-and-vncclient – dhruvvyas90 Sep 10 '15 at 06:39
  • Another approach (in case of remote desktop is not possible at all) could be using automizing tools such as xdotool or something similar. (There're couple of libraries for doing so in python). You can generate keyboard strokes and mouse clicks by command and other facilities such as focusing a window and lot more. One can have a look at this documentation : http://www.semicomplete.com/projects/xdotool/xdotool.xhtml more info. Hope it helps. – dhruvvyas90 Sep 10 '15 at 06:43

2 Answers2

1

If a GUI is out of the question (since your question states "from the terminal"), have a look at curl

However google isn't super friendly to curl.

So you might want to have a look here to have a more readable result.

Havnar
  • 1,617
  • 2
  • 16
  • 34
1

Try using xdg-open. This will open the site in the currently registered application for URIs on the remote linux system. If the browser is not already open, it will start it. If the application is already running, it will open a new tab (if the application allows it). Since you are using the remote display in the OP (export DISPLAY=:0) this will cause page to open there (again, as long as midori is your default browser - which you can check with xdg-settings --list).

Example:

xdg-open http://www.google.com

For more info on xdg-open, look here.

If, on the other hand, you are really wanting a remote-control style solution, without the extra weight of an RDP or TeamViewer style options, consider using something that allows a local XWin server (such as Cygwin does for Windows hosts, or already available in any linux system) for your SSH connection. Then all you will need to do is connect with -X in your ssh command and the application gui will arrive on your local system, but be running on the remote. In this way you will not need all the extra desktop stuff.

The NetYeti
  • 566
  • 4
  • 6