Run two X servers, or how to make an info screen


9 posts
by Gachl » Wed Jan 16, 2013 12:13 pm
Hello folks!

I'm currently planning a small project in which I'm going to hook a raspberry pi to a hdmi monitor and put it on the wall of my flat. I want to display several information
- Bus departure times
- Traffic
- Shoutbox
- Todo list

All the information I want to display are available on websites, basically all I need to do is to open each website, take a screenshot, cut the part that I'm interested in and combine it back to one 1080 sized image. But I'm not sure how I can achieve updating times of, say, 30 seconds without having the browser window displayed on the monitor.

My thought was, I am going to start two X servers, one that holds the browser where I get the screenshots from and a second one that is being displayed on my hdmi monitor with the patched-up image. I'm planning on doing this either in perl or python.
Is this a good way? Does this even work? Can I start two X servers (or displays?) Is there a better way to do this?

I appreciate any suggestions!
Posts: 5
Joined: Thu Nov 29, 2012 1:57 pm
by RaTTuS » Wed Jan 16, 2013 12:16 pm
wget on the pages you want then
use text tools to get the data you want and produce your own page
http://www.catb.org/esr/faqs/smart-questions.html <- ask smart Questions
"That's not right, the badgers have moved the goalposts."
1QC43qbL5FySu2Pi51vGqKqxy3UiJgukSX - Prosliver FTW
User avatar
Posts: 5339
Joined: Tue Nov 29, 2011 11:12 am
Location: North West UK
by Gachl » Wed Jan 16, 2013 12:27 pm
RaTTuS wrote:wget on the pages you want then
use text tools to get the data you want and produce your own page

that would be another way but I think combining all those different websites in one page will end in a very ugly mess that has to be maintained every time the source code of one of the websites changes slightly. I'd rather take the original rendered website for display.
Posts: 5
Joined: Thu Nov 29, 2012 1:57 pm
by rurwin » Wed Jan 16, 2013 1:14 pm
But with five different websites mashed onto the one screen, surely that will result in a very ugly mess that has to be maintained every time one of the websites changes slightly?

Another way to do it would be to write your own page which pulls in the others with <iframe>s, but that will pull in the whole page, not just a part of it. If there is an API or an RSS feed available, use that. Otherwise RaTTuS is right. A well-written web-page wont change much even if the look changes markedly, but of course the five you choose will, by Murphy's Law, be the worst written pages in web history.
User avatar
Forum Moderator
Forum Moderator
Posts: 2932
Joined: Mon Jan 09, 2012 3:16 pm
by -rst- » Wed Jan 16, 2013 4:06 pm
Gachl wrote:...cut the part that I'm interested in...


This requirement will mean some level of mess anyway if the original page layout changes...
http://raspberrycompote.blogspot.com/ - Low-level graphics and 'Coding Gold Dust'
Posts: 900
Joined: Thu Nov 01, 2012 12:12 pm
Location: Dublin, Ireland
by ghans » Thu Jan 17, 2013 9:22 am
How do you want to connect the two displays ?
I only know one person who succeeded with DisplayLink
ones , but after his tutorial i decided to wait till
i finally got my head around the harder parts of Linux :D.

ghans
• Don't like the board ? Missing features ? Change to the prosilver theme ! You can find it in your settings.
• Don't like to search the forum BEFORE posting 'cos it's useless ? Try googling : yoursearchtermshere site:raspberrypi.org
Posts: 4613
Joined: Mon Dec 12, 2011 8:30 pm
Location: Germany
by Danbert » Thu Jan 17, 2013 10:10 am
Does the information all have to be displayed at the same time, or could each page be displayed for (say) 10 seconds?

If you could display one page at a time then you could set up several virtual desktops, run the browser full screen showing the page that you want on each of them and use wmctrl to switch between them
Posts: 17
Joined: Mon Dec 05, 2011 2:52 pm
by Gachl » Fri Jan 18, 2013 9:21 am
Danbert wrote:Does the information all have to be displayed at the same time, or could each page be displayed for (say) 10 seconds?

If you could display one page at a time then you could set up several virtual desktops, run the browser full screen showing the page that you want on each of them and use wmctrl to switch between them

That's a nice idea, I could probably also hook a button from my monitor to gpio and when pressed it switces desktops. Yes, that's definitely better than making screenshots and stitching them together.
Posts: 5
Joined: Thu Nov 29, 2012 1:57 pm
by topguy » Sat Jan 19, 2013 8:44 pm
Why mess with multiple instances of desktops and browsers, if you can write a small html/javascript page that cycles the urls automatically.

http://stackoverflow.com/questions/8416 ... ough-pages

If the loading of the pages are too slow, you can maybe find something that cycles between already opened tabs in the browser.

There is even a shell tool called "xdotool" which can be used to send keypresses to the browser (any X-window).
User avatar
Posts: 681
Joined: Tue Oct 09, 2012 11:46 am
Location: Trondheim, Norway