<?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>asmw.de &#187; dwm</title>
	<atom:link href="http://asmw.de/?feed=rss2&#038;tag=dwm" rel="self" type="application/rss+xml" />
	<link>http://asmw.de</link>
	<description>...assembling words</description>
	<lastBuildDate>Mon, 16 Aug 2010 20:39:35 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>don&#8217;t unclutter dwm</title>
		<link>http://asmw.de/?p=148</link>
		<comments>http://asmw.de/?p=148#comments</comments>
		<pubDate>Tue, 29 Dec 2009 12:36:04 +0000</pubDate>
		<dc:creator>medha</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[dwm]]></category>
		<category><![CDATA[unclutter]]></category>

		<guid isPermaLink="false">http://asmw.de/?p=148</guid>
		<description><![CDATA[<p>It doesn&#8217;t like it. Unclutter is a little program which hides your mouse pointer if it idles.</p>
]]></description>
			<content:encoded><![CDATA[<p>It doesn&#8217;t like it. Unclutter is a little program which hides your mouse pointer if it idles.</p>
]]></content:encoded>
			<wfw:commentRss>http://asmw.de/?feed=rss2&amp;p=148</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Back to the awesome roots, with asynchronous status updates&#8230;</title>
		<link>http://asmw.de/?p=40</link>
		<comments>http://asmw.de/?p=40#comments</comments>
		<pubDate>Fri, 19 Jun 2009 11:14:02 +0000</pubDate>
		<dc:creator>medha</dc:creator>
				<category><![CDATA[nerdcore]]></category>
		<category><![CDATA[awesome]]></category>
		<category><![CDATA[dwm]]></category>
		<category><![CDATA[inotify]]></category>
		<category><![CDATA[python]]></category>

		<guid isPermaLink="false">http://www.asmw.de/?p=40</guid>
		<description><![CDATA[<p>Bye dwm&#8230; I&#8217;ve gone awesome again, the diet is over.</p>
<p>I&#8217;ll keep it as a backup in case awesome dies on me again, but I&#8217;ll go back to a meal with butter, thank you very much.</p>
<p>The small thing that led me back to awesome is the banality of colored statusbar entries. I know there&#8217;s a patch [...]]]></description>
			<content:encoded><![CDATA[<p>Bye <a href="http://dwm.suckless.org/">dwm</a>&#8230; I&#8217;ve gone <a href="http://awesome.naquadah.org/">awesome</a> again, the diet is over.</p>
<p>I&#8217;ll keep it as a backup in case awesome dies on me again, but I&#8217;ll go back to a meal with butter, thank you very much.</p>
<p>The small thing that led me back to awesome is the banality of colored statusbar entries. I know there&#8217;s a <a href="http://dwm.suckless.org/patches/">patch for dwm</a> which does that, but if I start patching up dwm to bloat up, I might as well just use something else.</p>
<p>I&#8217;m using a simple text widget in my awesome statusbar to display some basic stuff about my system:<br />
<img src="http://asmw.de/downloads/statusbar.jpg" alt="awesome statusbar, driven by inotify events" /></p>
<p>If you really want to know more, follow me&#8230;<br />
<span id="more-40"></span></p>
<p>The elements:</p>
<ul>
<li>e(w:X|b:X|c:X) &#8211; the rfkill status of my eeepcs <strong>w</strong>ireless and <strong>b</strong>luetooth and whether the <strong>c</strong>amera is activated</li>
<li>df(X) &#8211; how much <strong>d</strong>isk is still <strong>f</strong>ree</li>
<li>vl(X) &#8211; <strong>v</strong>o<strong>l</strong>ume setting of the LineOut channel and whether it is <span style="color: #ff0000;">muted</span></li>
<li>bt(X) &#8211; charge level of the <strong>b</strong>a<strong>t</strong>tery, turns red when low</li>
<li>nt(X) &#8211; <strong>n</strong>e<strong>t</strong>work device which provides my current default route or <span style="color: #ff0000;">None</span></li>
<li><span style="color: #ff0000;"><span style="color: #000000;">tm() &#8211; <strong>t</strong>i<strong>m</strong>e</span></span></li>
</ul>
<p>The default awesome config files suggest updating status items in fixed intervals of a few seconds, which makes sense for things like clocks etc, but do not work well for things which are &#8216;expensive&#8217; to check and rarely change, like volume settings and networks status, so I ditched that approach and looked for something which would</p>
<ul>
<li>React immediately if some action occurs, without delay</li>
<li>Not do polling</li>
</ul>
<p>Most modern distributions use something like e.g. <a href="http://www.freedesktop.org/wiki/Software/dbus">dbus</a> to push such information around the system. A daemon like <a href="http://en.wikipedia.org/wiki/HAL_(software)">hald</a> reacts to some hardware event (hotplug, rfkill, whatever) and uses dbus to notify clients.</p>
<p>While I like dbus in generall for <a href="http://en.wikipedia.org/wiki/Inter-process_communication">IPC</a>, it did not seem to carry all information I needed to fill my statusbar out of the box, so I used something else: <a href="http://en.wikipedia.org/wiki/Inotify">inotify</a>.</p>
<p>Inotify works by a program registering certain events (e.g. open, access, close) on a file or directory and when one of them happens the kernel tells you about it. I sniffed around the directory tree for usable files and put together a small python daemon which</p>
<ul>
<li>sets up inotify watches on these files</li>
<li>updates awesomes statusbar if something happens&#8230; via dbus <img src='http://asmw.de/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </li>
</ul>
<p>The code was thrown together to &#8216;just work&#8217;. Use at your own risk. You&#8217;ll need a couple of python modules to make this work, use the import list and deduction <img src='http://asmw.de/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  It works here with the 3.3 version of awesome from the debian unstable repositories. YMMV.</p>
<p><a href="http://asmw.de/downloads/awesome_inotify_status.tgz">awesome_inotify_status.tgz</a></p>
]]></content:encoded>
			<wfw:commentRss>http://asmw.de/?feed=rss2&amp;p=40</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
