[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
Void's Forums • View topic - controlling windows

controlling windows

Place to discuss Fedora and/or Red Hat

controlling windows

Postby byrdman » Tue Jun 16, 2009 12:12 pm

Don't let the topic fool you! My question is where can I control where certain windows, or applications start up. For example, for those that remember, I have been working on a full linux digital signage player. Nothing new here, but on my test laptop, I have a "Virtual" statement in my xorg.conf file that gives me a 2048 virtual desktop to sprawl across both my screens. I would like the ability to control Firefox in full-screen kiosk mode to either sprawl across both or have the ability to either open at 0,0 or 0,1024 by modifying a config file. did I explain good enough?
I also would like to find a way to hide the mouse cursor after 5 seconds of inactivity!! That would be golden!!
byrdman
administrator
administrator
 
Posts: 225
Joined: Thu May 08, 2003 1:59 pm
Location: In the cloud

Postby Void Main » Tue Jun 16, 2009 12:34 pm

What desktop you running? In gnome there is a session manager with a checkbox (that isn't checked by default) to remember saved sessions. I think if you check that box and start your applications and place them where you want then log out with them where you want them they will start up in that same location when you log back on. I would assume that if you can save a session like that you might be able to get that session to load every time. I could dig into it a little more. I don't know if there is an easy way to have the mouse disappear after a certain amount of time just by a configuration option but I know it can be done programatically because I know of several apps that do just that when you put them in full screen (video players like xine, mplayer, MythTV, etc). Here's a little on gnome sessions:

http://library.gnome.org/users/user-gui ... ns.html.en

Also, I think you might be able to do something in a firefox config as well as I know it remembers window size. Not sure about location though.
User avatar
Void Main
Site Admin
Site Admin
 
Posts: 5705
Joined: Wed Jan 08, 2003 5:24 am
Location: Tuxville, USA

Postby Void Main » Tue Jun 16, 2009 12:57 pm

I see where if the localstore.rdf becomes corrupt it will cause Firefox not to remember it's size. I assume that means it's size is recorded in that file. I looked at the file and it is text based. Might be able to manipulate that file accordingly. I'll look a little more into that as well.

http://kb.mozillazine.org/Toolbar_custo ... on_startup
http://kb.mozillazine.org/Localstore.rdf
User avatar
Void Main
Site Admin
Site Admin
 
Posts: 5705
Joined: Wed Jan 08, 2003 5:24 am
Location: Tuxville, USA

Postby Void Main » Tue Jun 16, 2009 1:02 pm

This might actually be just what you are looking for:

http://live.gnome.org/DevilsPie
User avatar
Void Main
Site Admin
Site Admin
 
Posts: 5705
Joined: Wed Jan 08, 2003 5:24 am
Location: Tuxville, USA

Postby Void Main » Tue Jun 16, 2009 6:20 pm

Regarding the mouse, this looks interesting:

http://www.linuxquestions.org/linux/ans ... kiosk_mode
User avatar
Void Main
Site Admin
Site Admin
 
Posts: 5705
Joined: Wed Jan 08, 2003 5:24 am
Location: Tuxville, USA

Postby Void Main » Tue Jun 16, 2009 6:24 pm

Actually this is exactly what you asked for regarding the mouse:

http://linux.about.com/cs/linux101/g/unclutter.htm

# yum install unclutter

It even defaults to 5 seconds. :)
User avatar
Void Main
Site Admin
Site Admin
 
Posts: 5705
Joined: Wed Jan 08, 2003 5:24 am
Location: Tuxville, USA

Postby byrdman » Wed Jun 17, 2009 1:01 pm

Thanks!! those worked perfectly. The Devils Pie is something that may come in handy when we start using it with multiple LCDs or Plasmas.
Now comes another question. I am loading a php page that reads from an XML file that points to the SWF files to play. I have all of these playing locally on apache through Firefox, Kiosk Mode. Rsync grabs the updated files and playlists and then they get copied into the html directory where it plays. QUESTION: how can I get firefox to reload/refresh WITHOUT closing firefox? I think I want something that says, 'when rsync runs, AND new files were copied, reload/refresh browser and grab the new XML files and SWF files." Does this question make sense?
byrdman
administrator
administrator
 
Posts: 225
Joined: Thu May 08, 2003 1:59 pm
Location: In the cloud

Postby Void Main » Wed Jun 17, 2009 1:16 pm

You are displaying this content in a web page in Firefox right? That is, your php script is generating the HTML with the embedded content that is displayed in Firefox right? Is it something that you can't have refresh on regular intervals using meta refresh in the HEAD section of your HTML?

http://en.wikipedia.org/wiki/Meta_refresh
User avatar
Void Main
Site Admin
Site Admin
 
Posts: 5705
Joined: Wed Jan 08, 2003 5:24 am
Location: Tuxville, USA

Postby byrdman » Wed Jun 17, 2009 1:35 pm

the META refresh will refresh and start the playlist over from the begining, so this is what I initially thought but it will not work. Different shows could have different lengths for each show, so it would be hard to find out what varible to put in the meta refresh. Also, I don't want it to refresh unless there is new content copied over from the rsync script. That is why I though if I had something along the lines of a script with rsync that said, "new files were copied, so [restart/reload/refresh] firefox; else do nothing.
I also tried restarting httpd without any luck. Or do you know of another way to do this?
byrdman
administrator
administrator
 
Posts: 225
Joined: Thu May 08, 2003 1:59 pm
Location: In the cloud

Postby Void Main » Wed Jun 17, 2009 1:54 pm

I think you would have to do this via code running in the brower (javascript, flash, java applet, etc). You would have a piece of code that checks for some indicator that there is no content out there and then refresh the browser/page/frame accordingly. There might also be a way to signal firefox to do a page refresh from outside of firefox but I am not aware of a way off the top of my head. I'll do some digging and see what I can come up with. I'm not quite sure I understand what you are doing there but think you've given enough information to answer your question. So if I understand you it IS ok to do a full refresh when the new content arrives right? That is it's ok that the playlist/movies start over at that point?
User avatar
Void Main
Site Admin
Site Admin
 
Posts: 5705
Joined: Wed Jan 08, 2003 5:24 am
Location: Tuxville, USA

Postby byrdman » Wed Jun 17, 2009 2:10 pm

Correct, if there is new files, then a full refresh would be acceptable.
For a quick run down, the Player.html file has an embedded 'player.swf' that it plays. This file has Playlist.xml as the source of files to play.
Ex:
<?xml version="1.0" encoding="ISO-8859-1"?>
<movies>
<movie url="show1.swf" />
<movie url="show2.swf" />
<movie url="MobileBanking.swf" />
<movie url="OnlineBanking.swf" />
<movie url="News.swf" />
<movie url="Stocks.swf" />
</movies>

If there are new swf files then the xml file will be updated. These will be transfered to a central server where the players will check in via rsync. I just need to somehow let firefox know that it has to reload/restart because there are updated files - and any file, because we may change the order of the files in the xml file which would then change the order that the swfs are played. Does this help?
byrdman
administrator
administrator
 
Posts: 225
Joined: Thu May 08, 2003 1:59 pm
Location: In the cloud

Postby Void Main » Wed Jun 17, 2009 2:16 pm

Yes I think so and I *think* this should be relatively easy to do. I'm pretty sure this sort of thing is commonly done with AJAX but I think it could be done with regular old JavaScript. I'll do some digging in a bit.
User avatar
Void Main
Site Admin
Site Admin
 
Posts: 5705
Joined: Wed Jan 08, 2003 5:24 am
Location: Tuxville, USA

Postby byrdman » Wed Jun 17, 2009 3:07 pm

I did find this:
http://www.mozilla.org/unix/remote.html

which will work if I type:
~]$ firefox -remote "openURL(http://localhost/Player.html)"

this restarts the browser. Perfect!
Now do you know how I could check for updated files?
something like
if (files updated) {
firefox -remote "openURL(http://localhost/Player.html)";
}
??
or am I going down a dead-end?
byrdman
administrator
administrator
 
Posts: 225
Joined: Thu May 08, 2003 1:59 pm
Location: In the cloud

Postby Void Main » Wed Jun 17, 2009 3:23 pm

User avatar
Void Main
Site Admin
Site Admin
 
Posts: 5705
Joined: Wed Jan 08, 2003 5:24 am
Location: Tuxville, USA

Postby Void Main » Wed Jun 17, 2009 3:34 pm

User avatar
Void Main
Site Admin
Site Admin
 
Posts: 5705
Joined: Wed Jan 08, 2003 5:24 am
Location: Tuxville, USA

Next

Return to Fedora/Red Hat

Who is online

Users browsing this forum: No registered users and 3 guests

cron