<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>mcmlxxii &#187; xulrunner</title>
	<atom:link href="http://mcmlxxii.co.uk/tag/xulrunner/feed/" rel="self" type="application/rss+xml" />
	<link>http://mcmlxxii.co.uk</link>
	<description></description>
	<lastBuildDate>Tue, 13 Mar 2012 19:53:40 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Turning Firefox into a web screensaver using a bash script</title>
		<link>http://mcmlxxii.co.uk/2009/04/19/turning-firefox-into-a-web-screensaver-using-a-bash-script/</link>
		<comments>http://mcmlxxii.co.uk/2009/04/19/turning-firefox-into-a-web-screensaver-using-a-bash-script/#comments</comments>
		<pubDate>Sun, 19 Apr 2009 21:44:26 +0000</pubDate>
		<dc:creator>mcmlxxii</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[bash]]></category>
		<category><![CDATA[command line]]></category>
		<category><![CDATA[command line options]]></category>
		<category><![CDATA[firefox]]></category>
		<category><![CDATA[screensaver]]></category>
		<category><![CDATA[ubuntu]]></category>
		<category><![CDATA[xulrunner]]></category>

		<guid isPermaLink="false">http://mcmlxxii.co.uk/?p=164</guid>
		<description><![CDATA[There&#8217;s a little program available for windows that lets you turn your browser into a screensaver, looping through various web content. However, there are 2 things wrong with it. Firstly it costs money. Secondly it doesn&#8217;t run on linux. So what? &#8211; we have bash &#8211; and after a bit of digging around this morning [...]]]></description>
			<content:encoded><![CDATA[<p>There&#8217;s a little program available for windows that lets you turn your browser into a screensaver, looping through various web content. However, there are 2 things wrong with it. Firstly it costs money. Secondly it doesn&#8217;t run on linux.</p>
<p>So what? &#8211; we have bash &#8211; and after a bit of digging around this morning and combining a few bits and pieces this is my version for Ubuntu <img src='http://mcmlxxii.co.uk/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>Firstly, in order to run firefox full screen we need the <a href="http://www.krickelkrackel.de/autohide/" target="_blank">AutoHide plugin</a>, which appears to have been written by someone with an interesting sense of humour.</p>
<p>Secondly, a small alteration needs to be made to the  javascript prefs file (.mozilla/firefox/$profile/prefs.js, $profile =  your profile). THIS MUST BE DONE WITH THE BROWSER CLOSED as Firefox overwrites the file on shutdown. Add these two lines at the end of the file:</p>
<p><code>user_pref("browser.link.open_external", 1);<br />
user_pref("browser.link.open_newwindow", 1);</code></p>
<p>Now that&#8217;s done there&#8217;s just a little bash script. Feel free to hack but if you improve it please let me know! I just saved the following few lines as a file &#8220;Webscreen&#8221; in my home directory:</p>
<p><code> </code></p>
<pre>#!/bin/bash

remoteclient=$(find /usr/lib/ -type f -name mozilla-xremote-client | grep -m 1 xulrunner)

if [ `ps -e | grep firefox | wc -l` -eq 0 ]; then

    /usr/bin/firefox -fullscreen &#038;
    sleep 5

fi

while [ `ps -e | grep firefox | wc -l` -gt 0 ]; do

    urls=$(cat /home/huff/Desktop/pages)

    for i in $urls
        do
        $remoteclient -a firefox "openurl($i)"

        if [ $? -gt 0 ]; then
            echo "Firefox not running or ignoring me, bailing out...."
            killall firefox
            exit 0
        fi
        sleep 15
        done
done
exit 0</pre>
<p>Note the path to the mozilla-xremote-client &#8211; this is correct on Ubuntu Jaunty but I had to use find to well, you know, find it:<br />
<code><br />
find /usr/lib -iname \*mozilla-xremote\*</code></p>
<p>As can be seen the script takes the pages you want to cycle through from a text file called (I felt quite pleased with this) &#8220;pages&#8221; on the Desktop, one url on each line such as:</p>
<p><code></p>
<p>http://bbc.co.uk</p>
<p>http://flickr.com</p>
<p>http://yoursite.whatever.com</p>
<p></code></p>
<p>and scrolls through the selection every 15 seconds.</p>
<p>The last detail is to<br />
<code><br />
chmod +x ~/Webscreen<br />
</code></p>
<p>and add a Custom Application Launcher to the panel. Thanks to mozilla for continuing the <a href="http://www.mozilla.org/unix/remote.html" target="_blank">command line options</a> started by Netscape and the cool AutoHide plugin, this was pretty easy. Hope it helps someone.</p>
]]></content:encoded>
			<wfw:commentRss>http://mcmlxxii.co.uk/2009/04/19/turning-firefox-into-a-web-screensaver-using-a-bash-script/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>

