<?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>The DF Lab &#187; cron</title>
	<atom:link href="http://blog.danfego.net/tag/cron/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.danfego.net</link>
	<description>A guy like me?</description>
	<lastBuildDate>Tue, 03 Nov 2009 15:31:40 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Cron, Backgrounds, and Fluxbox</title>
		<link>http://blog.danfego.net/2008/10/cron-backgrounds-and-fluxbox/</link>
		<comments>http://blog.danfego.net/2008/10/cron-backgrounds-and-fluxbox/#comments</comments>
		<pubDate>Sat, 04 Oct 2008 09:59:47 +0000</pubDate>
		<dc:creator>Dan</dc:creator>
				<category><![CDATA[linux]]></category>
		<category><![CDATA[bash]]></category>
		<category><![CDATA[cron]]></category>
		<category><![CDATA[fluxbox]]></category>
		<category><![CDATA[gentoo]]></category>

		<guid isPermaLink="false">http://dlflab.wordpress.com/?p=8</guid>
		<description><![CDATA[Honest to God, I spent so much time getting this blog, domain, etc. up, that I almost forgot what spurred me to get started. So here&#8217;s why&#8230; I had this problem. Rather, not so much a problem as a desire to rotate my backgrounds periodically. Let&#8217;s say&#8230; every 2 hours. Now, a guy like me, [...]]]></description>
			<content:encoded><![CDATA[<p>Honest to God, I spent so much time getting this blog, domain, etc. up, that I almost forgot what spurred me to get started. So here&#8217;s why&#8230; I had this problem. Rather, not so much a problem as a desire to rotate my backgrounds periodically. Let&#8217;s say&#8230; every 2 hours. Now, a guy like me, I think &#8220;cron!&#8221; This is the first thought of any veteran Linux user. However, I quickly came to the realization that I didn&#8217;t know quite how or where to put my cron entries, nor what format. This problem was, however, quickly remedied. That was not my problem.</p>
<p>The true problem arose when I attempted to actually implement changing my background. With fluxbox, this should be possible with a simple command like so:</p>
<p><code>fbsetbg -a -r /home/dfego/.fluxbox/backgrounds/</code></p>
<p>Simple enough, right? Well, as simple as it was, it just didn&#8217;t quite work. So I changed my cron timings, in case I got that wrong then used absolute paths, once again, just in case. Freaked out for a while, because the command itself works just fine. I ran it from a terminal about 29,834 times to make sure, but still, that little cron daemon that could just wouldn&#8217;t budge. It <em>would</em>, however, write the text &#8220;working&#8221; into ~/cronf*cker every minute. As a matter of fact, it still is. Allow me to go take care of that&#8230;</p>
<p>Now that that&#8217;s taken care of, I&#8217;ll go ahead and tell you what the real problem was. Apparently the cron daemon doesn&#8217;t have any inherent knowledge of the X display server I want to set the background of. Fair enough, since it starts running well before X gets started. But I didn&#8217;t realize this would matter, or even think about it at all until I saw a post online about setting fluxbox backgrounds in a more general sense. It proposed butting DISPLAY=:0.0 before the line, like so:</p>
<p><code>DISPLAY=:0.0 fbsetbg -a -r /home/dfego/.fluxbox/backgrounds/</code></p>
<p>I changed the file, bit my lip, and a second or so after the next minute passed, my background was changed anew! As a note, my X server is not using display :0.0, but rather :1.0. You can find out what your value is by opening up a terminal and typing:</p>
<p><code>echo $DISPLAY</code></p>
<p>Anyway, there you have it. My first pearl of wisdom to the world! Apologies for verbosity, but sometimes in explanations such as this, it helps. So the moral of the story/digest version: <strong>be aware of context when running commands for X!</strong> Or something like that. I actually was at work today trying to impress a co-worker of mine with the power of the command line, but unfortunately my attempt fell flat on its face when passing commands to xmessage. I&#8217;m not too worried about it though. My ping/grep antics seemed to be enough to win him over.</p>
<p>With that, I&#8217;m off to bed, and to watch my background change once more before daybreak!</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.danfego.net/2008/10/cron-backgrounds-and-fluxbox/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
