<?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>Sylvan Korvus &#187; Mac</title>
	<atom:link href="http://www.korvus.com/blog/tags/mac/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.korvus.com</link>
	<description></description>
	<lastBuildDate>Fri, 25 Nov 2011 01:43:51 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=</generator>
		<item>
		<title>DailyZen in GeekTool</title>
		<link>http://www.korvus.com/blog/geek/dailyzen-in-geektool/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=dailyzen-in-geektool</link>
		<comments>http://www.korvus.com/blog/geek/dailyzen-in-geektool/#comments</comments>
		<pubDate>Sat, 06 Jun 2009 22:04:52 +0000</pubDate>
		<dc:creator>Sylvan</dc:creator>
				<category><![CDATA[geek]]></category>
		<category><![CDATA[Mac]]></category>

		<guid isPermaLink="false">http://www.korvus.com/?p=170</guid>
		<description><![CDATA[I have been playing with GeekTool the last few days. It&#8217;s a small app for Mac OS X (preferences pane, actually) that adds text and images directly to the desktop. It&#8217;s highly scriptable and customizable, with people adding anything from the date and time, to log files, to RSS feeds and live satellite photos. One [...]]]></description>
			<content:encoded><![CDATA[<p><img class="alignright size-full wp-image-173" title="syldesk-zencropped-sm" src="http://www.korvus.com/kwp/wp-content/uploads/2009/06/syldesk-zencropped-sm.png" alt="syldesk-zencropped-sm" width="303" height="128" />I have been playing with <a href="http://projects.tynsoe.org/en/geektool/">GeekTool</a> the last few days. It&#8217;s a small app for Mac OS X (preferences pane, actually) that adds text and images directly to the desktop. It&#8217;s highly scriptable and customizable, with people adding anything from the date and time, to log files, to RSS feeds and live satellite photos.</p>
<p>One thing I&#8217;ve added to my own desktop, is the Zen poem posted daily on the website <a href="http://www.dailyzen.com/">DailyZen.com</a>. It took a little work to be able to do it, so I thought I&#8217;d post my script. <span id="more-170"></span>This is based  on the script to fetch a quote from Encarta as <a href="http://www.flickr.com/photos/barm/3297965686/#comment72157614210120597">posted on Flickr by barm</a>, so credit goes to him for getting me started.</p>
<p>This can all be pasted into GeekTool itself, or you can create a separate shell script <em>(eg. dailyzen.sh)</em>, which is what I&#8217;ve done, for easy editing. It&#8217;s a short one-liner, but there&#8217;s a lot going on:</p>
<p><code>curl -s http://www.dailyzen.com/ | sed -n &quot;/&lt;\!--Add Quote for correct day--&gt;/,/&lt;\/TD&gt;/p&quot;|sed -e &quot;s/&lt;[^&gt;]*&gt;//g&quot; |strings|fold -sw60</code></p>
<p><em>curl</em> of course is the Unix utility to fetch an URL, and grabs the contents of the front page of <a href="http://www.dailyzen.com/">http://www.dailyzen.com/</a>. <em>sed</em> then extracts the portion between the comment and the closing &lt;/TD&gt; tag, which contains the poem. The second <em>sed</em> command strips all HTML tags. I used <em>strings</em> to reliably get rid of some stray carriage returns, and finally <em>fold</em> wraps the poem to a nice width without breaking words, as GeekTool would do otherwise.</p>
<p>The script is straightforward to add to GeekTool, it&#8217;s simply a Shell command (either pasted in, or calling the dailyzen.sh file). I set the refresh time to 21600; 6 hours is enough to make sure it&#8217;s updated in the morning. I used Book Antiqua Italic 20pt for the text, white with 20% opacity.</p>
<p>And here&#8217;s the end result:</p>
<div id="attachment_168" class="wp-caption aligncenter" style="width: 310px"><a href="http://www.korvus.com/kwp/wp-content/uploads/2009/06/syldesk-geektool.png" rel="lightbox[170]"><img class="size-medium wp-image-168 " title="Sylvan Korvus - GeekTool Desktop" src="http://www.korvus.com/kwp/wp-content/uploads/2009/06/syldesk-geektool-300x187.png" alt="Sylvan Korvus - GeekTool Desktop" width="300" height="187" /></a><p class="wp-caption-text">My GeekTool Desktop, with DailyZen quote</p></div>
]]></content:encoded>
			<wfw:commentRss>http://www.korvus.com/blog/geek/dailyzen-in-geektool/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	</channel>
</rss>

