<?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>WebFramp</title>
	<atom:link href="http://www.webframp.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.webframp.com</link>
	<description>passing thoughts on the web</description>
	<lastBuildDate>Thu, 17 Sep 2009 19:34:20 +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>By Request: ZSH config</title>
		<link>http://www.webframp.com/2009/09/17/by-request-zsh-config/</link>
		<comments>http://www.webframp.com/2009/09/17/by-request-zsh-config/#comments</comments>
		<pubDate>Thu, 17 Sep 2009 19:31:14 +0000</pubDate>
		<dc:creator>sean</dc:creator>
				<category><![CDATA[*nix]]></category>

		<guid isPermaLink="false">http://www.webframp.com/?p=154</guid>
		<description><![CDATA[t]]></description>
			<content:encoded><![CDATA[<p>Somebody asked for it, so here&#8217;s my zsh configuration, cobbled together from various bits around the internet.</p>
<p>A screenshot of the two prompts, Aarron&#8217;s, then Phil&#8217;s:<br />
<img src="http://www.webframp.com/wp-content/uploads/2009/09/ss-prompt.png" alt="ZSH prompts" title="ZSH prompts" width="600" height="100" class="alignnone size-full wp-image-155" /></p>
<p>All 3 files can be downloaded here: <a href="http://www.webframp.com/files/webframp-zsh.tar.gz">webframp-zsh.tar.gz</a></p>
<p>The main .zshrc:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;"># zsh user configuration file.</span>
<span style="color: #666666; font-style: italic;"># Used by: Sean Escriva &lt;sean.escriva[AT]gmail[DOT]com&gt;</span>
<span style="color: #666666; font-style: italic;">#</span>
<span style="color: #007800;">ZSHROOT</span>=<span style="color: #ff0000;">&quot;<span style="color: #007800;">${HOME}</span>/.zsh&quot;</span>
<span style="color: #007800;">WORDCHARS</span>=<span style="color: #800000;">${WORDCHARS:s,/,,}</span>
<span style="color: #7a0874; font-weight: bold;">umask</span> 002 <span style="color: #666666; font-style: italic;"># less secure</span>
<span style="color: #666666; font-style: italic;">#umask 077 # more secure</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># vi is the editor, emacs for ZLE</span>
bindkey <span style="color: #660033;">-e</span>
<span style="color: #666666; font-style: italic;"># or</span>
<span style="color: #666666; font-style: italic;"># vi all the time</span>
<span style="color: #666666; font-style: italic;">#bindkey -v</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># MODULES</span>
zmodload zsh<span style="color: #000000; font-weight: bold;">/</span>complist
autoload <span style="color: #660033;">-Uz</span> compinit <span style="color: #000000; font-weight: bold;">&amp;&amp;</span> compinit
autoload <span style="color: #660033;">-Uz</span> colors <span style="color: #000000; font-weight: bold;">&amp;&amp;</span> colors
autoload <span style="color: #660033;">-Uz</span> zsh-mime-setup <span style="color: #000000; font-weight: bold;">&amp;&amp;</span> zsh-mime-setup
&nbsp;
<span style="color: #666666; font-style: italic;"># FUNCTIONS</span>
bindkey <span style="color: #ff0000;">&quot;\e[1~&quot;</span> beginning-of-line
bindkey <span style="color: #ff0000;">&quot;\e[4~&quot;</span> end-of-line
bindkey <span style="color: #ff0000;">&quot;\e[5~&quot;</span> beginning-of-history
bindkey <span style="color: #ff0000;">&quot;\e[6~&quot;</span> end-of-history
bindkey <span style="color: #ff0000;">&quot;\e[3~&quot;</span> delete-char
bindkey <span style="color: #ff0000;">&quot;\e[2~&quot;</span> quoted-insert
bindkey <span style="color: #ff0000;">&quot;\e[5C&quot;</span> forward-word
bindkey <span style="color: #ff0000;">&quot;\eOc&quot;</span> emacs-forward-word
bindkey <span style="color: #ff0000;">&quot;\e[5D&quot;</span> backward-word
bindkey <span style="color: #ff0000;">&quot;\eOd&quot;</span> emacs-backward-word
bindkey <span style="color: #ff0000;">&quot;\e\e[C&quot;</span> forward-word
bindkey <span style="color: #ff0000;">&quot;\e\e[D&quot;</span> backward-word
bindkey <span style="color: #ff0000;">&quot;^H&quot;</span> backward-delete-word
<span style="color: #666666; font-style: italic;"># for rxvt</span>
bindkey <span style="color: #ff0000;">&quot;\e[8~&quot;</span> end-of-line
bindkey <span style="color: #ff0000;">&quot;\e[7~&quot;</span> beginning-of-line
<span style="color: #666666; font-style: italic;"># for non RH/Debian xterm, can't hurt for RH/DEbian xterm</span>
bindkey <span style="color: #ff0000;">&quot;\eOH&quot;</span> beginning-of-line
bindkey <span style="color: #ff0000;">&quot;\eOF&quot;</span> end-of-line
<span style="color: #666666; font-style: italic;"># for freebsd console</span>
bindkey <span style="color: #ff0000;">&quot;\e[H&quot;</span> beginning-of-line
bindkey <span style="color: #ff0000;">&quot;\e[F&quot;</span> end-of-line
<span style="color: #666666; font-style: italic;"># completion in the middle of a line</span>
bindkey <span style="color: #ff0000;">'^i'</span> expand-or-complete-prefix
&nbsp;
<span style="color: #666666; font-style: italic;"># patten search history</span>
bindkey <span style="color: #ff0000;">'^R'</span> history-incremental-pattern-search-backward
bindkey <span style="color: #ff0000;">'[^R'</span> history-incremental-pattern-search-forward
&nbsp;
<span style="color: #666666; font-style: italic;"># OPTIONS</span>
<span style="color: #666666; font-style: italic;"># may try inc_append_history instead of share_history</span>
<span style="color: #666666; font-style: italic;"># require fc -RI to import new hist entries though</span>
setopt \
autocd \
autolist \
autopushd \
autoresume \
append_history \
banghist \
beep \
correct	\
correctall \
cdablevars \
NO_clobber \
NO_checkjobs \
extendedglob \
NO_flowcontrol \
globdots \
histsavenodups \
histfindnodups \
histignorealldups \
histignorespace \
histreduceblanks \
histverify \
sharehistory \
NO_hup \
longlistjobs \
NO_mailwarning \
multios \
notify \
pathdirs \
pushdtohome	\
pushdignoredups \
pushdminus \
pushdsilent	\
rcquotes \
recexact 
&nbsp;
unsetopt \
bgnice \
autoparamslash
&nbsp;
<span style="color: #666666; font-style: italic;"># ALIASES</span>
<span style="color: #7a0874; font-weight: bold;">alias</span> <span style="color: #007800;">l</span>=<span style="color: #ff0000;">'ls -F -h --color'</span>
<span style="color: #7a0874; font-weight: bold;">alias</span> <span style="color: #007800;"><span style="color: #c20cb9; font-weight: bold;">ls</span></span>=<span style="color: #ff0000;">'ls -F -h --color'</span>
<span style="color: #7a0874; font-weight: bold;">alias</span> <span style="color: #007800;">ll</span>=<span style="color: #ff0000;">'ls -l -F -h --color'</span>
<span style="color: #7a0874; font-weight: bold;">alias</span> <span style="color: #007800;">la</span>=<span style="color: #ff0000;">'ls -a -F -h --color'</span>
<span style="color: #7a0874; font-weight: bold;">alias</span> <span style="color: #007800;">lla</span>=<span style="color: #ff0000;">'ls -l -a -F -h --color'</span>
<span style="color: #7a0874; font-weight: bold;">alias</span> <span style="color: #007800;"><span style="color: #c20cb9; font-weight: bold;">mv</span></span>=<span style="color: #ff0000;">'nocorrect mv'</span>
<span style="color: #7a0874; font-weight: bold;">alias</span> <span style="color: #007800;"><span style="color: #7a0874; font-weight: bold;">cd</span></span>=<span style="color: #ff0000;">'nocorrect cd'</span>
<span style="color: #7a0874; font-weight: bold;">alias</span> <span style="color: #007800;"><span style="color: #c20cb9; font-weight: bold;">cp</span></span>=<span style="color: #ff0000;">'nocorrect cp'</span>
<span style="color: #7a0874; font-weight: bold;">alias</span> <span style="color: #007800;"><span style="color: #c20cb9; font-weight: bold;">mkdir</span></span>=<span style="color: #ff0000;">'nocorrect mkdir'</span>
<span style="color: #7a0874; font-weight: bold;">alias</span> <span style="color: #007800;"><span style="color: #c20cb9; font-weight: bold;">man</span></span>=<span style="color: #ff0000;">'nocorrect man'</span>
<span style="color: #7a0874; font-weight: bold;">alias</span> <span style="color: #007800;"><span style="color: #c20cb9; font-weight: bold;">find</span></span>=<span style="color: #ff0000;">'noglob find'</span>
<span style="color: #7a0874; font-weight: bold;">alias</span> <span style="color: #007800;"><span style="color: #c20cb9; font-weight: bold;">gcc</span></span>=<span style="color: #ff0000;">'nocorrect gcc'</span>
<span style="color: #7a0874; font-weight: bold;">alias</span> <span style="color: #007800;"><span style="color: #c20cb9; font-weight: bold;">scp</span></span>=<span style="color: #ff0000;">'nocorrect scp'</span>
<span style="color: #7a0874; font-weight: bold;">alias</span> <span style="color: #007800;">grepc</span>=<span style="color: #ff0000;">'grep --color=always'</span>
<span style="color: #7a0874; font-weight: bold;">alias</span> <span style="color: #007800;">myip</span>=<span style="color: #ff0000;">'print ${${$(LC_ALL=C /sbin/ifconfig eth0)[7]}:gs/addr://}'</span>
<span style="color: #7a0874; font-weight: bold;">alias</span> <span style="color: #007800;">xp</span>=<span style="color: #ff0000;">'xprop | grep &quot;WM_WINDOW_ROLE\|WM_CLASS\|^WM_NAME&quot;'</span> 
&nbsp;
<span style="color: #666666; font-style: italic;"># command equivalents</span>
<span style="color: #7a0874; font-weight: bold;">alias</span> <span style="color: #660033;">-g</span> <span style="color: #007800;">L</span>=<span style="color: #ff0000;">'|less'</span>
<span style="color: #7a0874; font-weight: bold;">alias</span> <span style="color: #660033;">-g</span> <span style="color: #007800;">S</span>=<span style="color: #ff0000;">'&amp;&gt; /dev/null &amp;'</span>
<span style="color: #7a0874; font-weight: bold;">alias</span> <span style="color: #660033;">-g</span> <span style="color: #007800;">G</span>=<span style="color: #ff0000;">'|grep'</span>
<span style="color: #7a0874; font-weight: bold;">alias</span> <span style="color: #660033;">-g</span> <span style="color: #007800;">GC</span>=<span style="color: #ff0000;">'|grep --color=always'</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># Now for the stupid aliases (mostly my stupidity)</span>
<span style="color: #7a0874; font-weight: bold;">alias</span> <span style="color: #007800;">sl</span>=<span style="color: #ff0000;">'ls'</span>
<span style="color: #7a0874; font-weight: bold;">alias</span> <span style="color: #007800;">cdd</span>=<span style="color: #ff0000;">'cd'</span>
<span style="color: #7a0874; font-weight: bold;">alias</span> <span style="color: #007800;">mmv</span>=<span style="color: #ff0000;">'mv'</span>
&nbsp;
<span style="color: #7a0874; font-weight: bold;">alias</span> <span style="color: #007800;">zshrc</span>=<span style="color: #ff0000;">'vim ~/.zshrc'</span>
<span style="color: #7a0874; font-weight: bold;">alias</span> <span style="color: #007800;">x</span>=<span style="color: #ff0000;">'startx'</span>
<span style="color: #7a0874; font-weight: bold;">alias</span> <span style="color: #007800;">v</span>=<span style="color: #ff0000;">'vim'</span>
<span style="color: #7a0874; font-weight: bold;">alias</span> <span style="color: #007800;">startwin</span>=<span style="color: #ff0000;">'VBoxManage startvm Vista'</span>
<span style="color: #7a0874; font-weight: bold;">alias</span> <span style="color: #007800;">stopwin</span>=<span style="color: #ff0000;">'VBoxManage controlvm Vista savestate'</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># suffix aliases</span>
<span style="color: #7a0874; font-weight: bold;">alias</span> <span style="color: #660033;">-s</span> <span style="color: #007800;">flac</span>=<span style="color: #c20cb9; font-weight: bold;">mplayer</span>
<span style="color: #7a0874; font-weight: bold;">alias</span> <span style="color: #660033;">-s</span> <span style="color: #007800;">mp3</span>=<span style="color: #c20cb9; font-weight: bold;">mplayer</span>
<span style="color: #7a0874; font-weight: bold;">alias</span> <span style="color: #660033;">-s</span> <span style="color: #007800;">ogg</span>=<span style="color: #c20cb9; font-weight: bold;">mplayer</span>
<span style="color: #7a0874; font-weight: bold;">alias</span> <span style="color: #660033;">-s</span> <span style="color: #007800;">wav</span>=<span style="color: #c20cb9; font-weight: bold;">mplayer</span>
<span style="color: #7a0874; font-weight: bold;">alias</span> <span style="color: #660033;">-s</span> <span style="color: #007800;">avi</span>=<span style="color: #c20cb9; font-weight: bold;">mplayer</span>
<span style="color: #7a0874; font-weight: bold;">alias</span> <span style="color: #660033;">-s</span> <span style="color: #007800;">mpeg</span>=<span style="color: #c20cb9; font-weight: bold;">mplayer</span>
<span style="color: #7a0874; font-weight: bold;">alias</span> <span style="color: #660033;">-s</span> <span style="color: #007800;">mpg</span>=<span style="color: #c20cb9; font-weight: bold;">mplayer</span>
<span style="color: #7a0874; font-weight: bold;">alias</span> <span style="color: #660033;">-s</span> <span style="color: #007800;">wmv</span>=<span style="color: #c20cb9; font-weight: bold;">mplayer</span>
<span style="color: #7a0874; font-weight: bold;">alias</span> <span style="color: #660033;">-s</span> <span style="color: #007800;">org</span>=<span style="color: #007800;">$BROWSER</span>
<span style="color: #7a0874; font-weight: bold;">alias</span> <span style="color: #660033;">-s</span> <span style="color: #007800;">com</span>=<span style="color: #007800;">$BROWSER</span>
<span style="color: #7a0874; font-weight: bold;">alias</span> <span style="color: #660033;">-s</span> <span style="color: #007800;">net</span>=<span style="color: #007800;">$BROWSER</span>
<span style="color: #7a0874; font-weight: bold;">alias</span> <span style="color: #660033;">-s</span> <span style="color: #007800;">html</span>=<span style="color: #007800;">$BROWSER</span>
<span style="color: #7a0874; font-weight: bold;">alias</span> <span style="color: #660033;">-s</span> <span style="color: #007800;">bmp</span>=feh
<span style="color: #7a0874; font-weight: bold;">alias</span> <span style="color: #660033;">-s</span> <span style="color: #007800;">png</span>=feh
<span style="color: #7a0874; font-weight: bold;">alias</span> <span style="color: #660033;">-s</span> <span style="color: #007800;">jpg</span>=feh
<span style="color: #7a0874; font-weight: bold;">alias</span> <span style="color: #660033;">-s</span> <span style="color: #007800;">jpeg</span>=feh
<span style="color: #7a0874; font-weight: bold;">alias</span> <span style="color: #660033;">-s</span> <span style="color: #007800;">gif</span>=feh
<span style="color: #7a0874; font-weight: bold;">alias</span> <span style="color: #660033;">-s</span> <span style="color: #007800;">odt</span>=oowriter
<span style="color: #7a0874; font-weight: bold;">alias</span> <span style="color: #660033;">-s</span> <span style="color: #007800;">sxw</span>=oowriter
<span style="color: #7a0874; font-weight: bold;">alias</span> <span style="color: #660033;">-s</span> <span style="color: #007800;">doc</span>=oowriter
<span style="color: #7a0874; font-weight: bold;">alias</span> <span style="color: #660033;">-s</span> <span style="color: #007800;">pdf</span>=apvlv
<span style="color: #7a0874; font-weight: bold;">alias</span> <span style="color: #660033;">-s</span> <span style="color: #007800;">pyc</span>=python
<span style="color: #7a0874; font-weight: bold;">alias</span> <span style="color: #660033;">-s</span> <span style="color: #007800;">PKGBUILD</span>=<span style="color: #007800;">$EDITOR</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># COMPSYS</span>
zstyle <span style="color: #660033;">-e</span> <span style="color: #ff0000;">':completion:*:approximate:*'</span> max-errors <span style="color: #ff0000;">'reply=( $(( ($#PREFIX + $#SUFFIX) / 3 )) )'</span>
<span style="color: #666666; font-style: italic;">#zstyle ':completion:*:descriptions' format &quot;- %d -&quot;</span>
<span style="color: #666666; font-style: italic;">#zstyle ':completion:*:corrections' format &quot;- %d - (errors %e})&quot;</span>
zstyle <span style="color: #ff0000;">':completion:*:default'</span> list-prompt <span style="color: #ff0000;">'%S%M matches%s'</span> <span style="color: #666666; font-style: italic;"># display list, below prompt.</span>
zstyle <span style="color: #ff0000;">':completion:*'</span> group-name <span style="color: #ff0000;">''</span>
zstyle <span style="color: #ff0000;">':completion:*:manuals'</span> separate-sections <span style="color: #c20cb9; font-weight: bold;">true</span>
zstyle <span style="color: #ff0000;">':completion:*:manuals.(^1*)'</span> insert-sections <span style="color: #c20cb9; font-weight: bold;">true</span>
zstyle <span style="color: #ff0000;">':completion:*'</span> menu <span style="color: #000000; font-weight: bold;">select</span>
zstyle <span style="color: #ff0000;">':completion:*'</span> verbose <span style="color: #c20cb9; font-weight: bold;">yes</span>
zstyle <span style="color: #ff0000;">':completion:*'</span> list-colors <span style="color: #ff0000;">''</span>
zstyle <span style="color: #ff0000;">':completion:*'</span> list-colors <span style="color: #ff0000;">&quot;<span style="color: #007800;">$LS_COLORS</span>&quot;</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># caching</span>
zstyle <span style="color: #ff0000;">':completion:*'</span> use-cache on
zstyle <span style="color: #ff0000;">':completion:*'</span> cache-path ~<span style="color: #000000; font-weight: bold;">/</span>.zsh<span style="color: #000000; font-weight: bold;">/</span>completion.cache
<span style="color: #666666; font-style: italic;"># remove slash if argument is a directory</span>
zstyle <span style="color: #ff0000;">':completion:*'</span> squeeze-slashes <span style="color: #c20cb9; font-weight: bold;">true</span>
<span style="color: #666666; font-style: italic;"># history</span>
zstyle <span style="color: #ff0000;">':completion:*:history-words'</span> stop <span style="color: #c20cb9; font-weight: bold;">yes</span>
zstyle <span style="color: #ff0000;">':completion:*:history-words'</span> remove-all-dups <span style="color: #c20cb9; font-weight: bold;">yes</span>
zstyle <span style="color: #ff0000;">':completion:*:history-words'</span> list <span style="color: #c20cb9; font-weight: bold;">false</span>
zstyle <span style="color: #ff0000;">':completion:*:history-words'</span> menu <span style="color: #c20cb9; font-weight: bold;">yes</span>
&nbsp;
zstyle <span style="color: #ff0000;">':completion:*:descriptions'</span> format $<span style="color: #ff0000;">'%{\e[0;31m%}completing %B%d%b%{\e[0m%}'</span>
zstyle <span style="color: #ff0000;">':completion:*:corrections'</span> format $<span style="color: #ff0000;">'%{\e[0;31m%}%d (errors: %e)%}'</span>
zstyle <span style="color: #ff0000;">':completion:*:messages'</span> format <span style="color: #ff0000;">'%d'</span>
zstyle <span style="color: #ff0000;">':completion:*:warnings'</span> format $<span style="color: #ff0000;">'%{\e[0;31m%}No matches for:%{\e[0m%} %d'</span>
zstyle <span style="color: #ff0000;">':completion:*:corrections'</span> format <span style="color: #ff0000;">'%B%d (errors: %e)%b'</span>
zstyle <span style="color: #ff0000;">':completion:*'</span> format <span style="color: #ff0000;">'completing %d'</span>
zstyle <span style="color: #ff0000;">':completion:*'</span> format $<span style="color: #ff0000;">'%{\e[0;31m%}completing %B%d%b%{\e[0m%}'</span>
zstyle <span style="color: #ff0000;">':completion:*'</span> group-name <span style="color: #ff0000;">''</span>
zstyle <span style="color: #ff0000;">':completion:*'</span> verbose <span style="color: #c20cb9; font-weight: bold;">yes</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># cd directory stack menu</span>
zstyle <span style="color: #ff0000;">':completion:*:*:cd:*:directory-stack'</span> menu <span style="color: #c20cb9; font-weight: bold;">yes</span> <span style="color: #000000; font-weight: bold;">select</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># approximation</span>
zstyle <span style="color: #ff0000;">':completion:*'</span> completer _complete _match _approximate
zstyle <span style="color: #ff0000;">':completion:*:match:*'</span> original only
zstyle <span style="color: #660033;">-e</span> <span style="color: #ff0000;">':completion:*:approximate:*'</span> max-errors <span style="color: #ff0000;">'reply=( $(( ($#PREFIX+$#SUFFIX)/3 )) numeric )'</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># array completion element sorting</span>
zstyle <span style="color: #ff0000;">':completion:*:*:-subscript-:*'</span> tag-order indexes parameters
&nbsp;
<span style="color: #666666; font-style: italic;"># ssh, scp, ping, host</span>
<span style="color: #7a0874; font-weight: bold;">test</span> <span style="color: #000000; font-weight: bold;">!</span> <span style="color: #660033;">-d</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">$HOME</span>/.ssh&quot;</span> <span style="color: #000000; font-weight: bold;">&amp;&amp;</span> <span style="color: #c20cb9; font-weight: bold;">mkdir</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">$HOME</span>/.ssh&quot;</span>
<span style="color: #7a0874; font-weight: bold;">test</span> <span style="color: #000000; font-weight: bold;">!</span> <span style="color: #660033;">-f</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">$HOME</span>/.ssh/known_hosts&quot;</span> <span style="color: #000000; font-weight: bold;">&amp;&amp;</span> <span style="color: #c20cb9; font-weight: bold;">touch</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">$HOME</span>/.ssh/known_hosts&quot;</span>
<span style="color: #7a0874; font-weight: bold;">test</span> <span style="color: #000000; font-weight: bold;">!</span> <span style="color: #660033;">-f</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">$HOME</span>/.ssh/config&quot;</span> <span style="color: #000000; font-weight: bold;">&amp;&amp;</span> <span style="color: #c20cb9; font-weight: bold;">touch</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">$HOME</span>/.ssh/config&quot;</span>
&nbsp;
zstyle <span style="color: #ff0000;">':completion:*:(scp|rsync):*'</span> tag-order \
        <span style="color: #ff0000;">'hosts:-host hosts:-domain:domain hosts:-ipaddr:IP\ address *'</span>
zstyle <span style="color: #ff0000;">':completion:*:(scp|rsync):*'</span> group-order \
        <span style="color: #c20cb9; font-weight: bold;">users</span> files all-files hosts-domain hosts-host hosts-ipaddr
zstyle <span style="color: #ff0000;">':completion:*:ssh:*'</span> tag-order \
        <span style="color: #c20cb9; font-weight: bold;">users</span> <span style="color: #ff0000;">'hosts:-host hosts:-domain:domain hosts:-ipaddr:IP\ address *'</span>
zstyle <span style="color: #ff0000;">':completion:*:ssh:*'</span> group-order \
        hosts-domain hosts-host <span style="color: #c20cb9; font-weight: bold;">users</span> hosts-ipaddr
&nbsp;
zstyle <span style="color: #ff0000;">':completion:*:(ssh|scp|rsync):*:hosts-host'</span> ignored-patterns \
        <span style="color: #ff0000;">'*.*'</span> loopback localhost
zstyle <span style="color: #ff0000;">':completion:*:(ssh|scp|rsync):*:hosts-domain'</span> ignored-patterns \
        <span style="color: #ff0000;">'&lt;-&gt;.&lt;-&gt;.&lt;-&gt;.&lt;-&gt;'</span> <span style="color: #ff0000;">'^*.*'</span> <span style="color: #ff0000;">'*@*'</span>
zstyle <span style="color: #ff0000;">':completion:*:(ssh|scp|rsync):*:hosts-ipaddr'</span> ignored-patterns \
        <span style="color: #ff0000;">'^&lt;-&gt;.&lt;-&gt;.&lt;-&gt;.&lt;-&gt;'</span> <span style="color: #ff0000;">'127.0.0.&lt;-&gt;'</span>
zstyle <span style="color: #ff0000;">':completion:*:(ssh|scp|rsync):*:users'</span> ignored-patterns \
        adm bin daemon halt <span style="color: #c20cb9; font-weight: bold;">lp</span> named shutdown <span style="color: #c20cb9; font-weight: bold;">sync</span>
&nbsp;
zstyle <span style="color: #660033;">-e</span> <span style="color: #ff0000;">':completion:*:(ssh|scp|ping|host|nmap|rsync):*'</span> hosts <span style="color: #ff0000;">'reply=(
        ${=${${(f)&quot;$(cat {/etc/ssh_,~/.ssh/known_}hosts(|2)(N) \
                        /dev/null)&quot;}%%[#| ]*}//,/ }
        ${=${(f)&quot;$(cat /etc/hosts(|)(N) &lt;&lt;(ypcat hosts 2&gt;/dev/null))&quot;}%%\#*}
        ${=${${${${(@M)${(f)&quot;$(&lt;~/.ssh/config)&quot;}:#Host *}#Host }:#*\**}:#*\?*}}
        )'</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># kill</span>
<span style="color: #666666; font-style: italic;">#zstyle ':completion:*:*:kill:*:processes' list-colors &quot;=(#b) #([0-9]#)*=$color[cyan]=$color[red]&quot;</span>
zstyle <span style="color: #ff0000;">':completion:*:*:kill:*:processes'</span> list-colors <span style="color: #ff0000;">'=(#b) #([0-9]#)*=0=01;31'</span>
zstyle <span style="color: #ff0000;">':completion:*:*:kill:*'</span> menu <span style="color: #c20cb9; font-weight: bold;">yes</span> <span style="color: #000000; font-weight: bold;">select</span>
zstyle <span style="color: #ff0000;">':completion:*:kill:*'</span> force-list always
zstyle <span style="color: #ff0000;">':completion:*:kill:*'</span> <span style="color: #7a0874; font-weight: bold;">command</span> <span style="color: #ff0000;">'ps -u $USER -o pid,%cpu,tty,cputime,cmd'</span>
zstyle <span style="color: #ff0000;">':completion:*:kill:*'</span> insert-ids single
zstyle <span style="color: #ff0000;">':completion:*:*:kill:*'</span> menu <span style="color: #c20cb9; font-weight: bold;">yes</span> <span style="color: #000000; font-weight: bold;">select</span>
zstyle <span style="color: #ff0000;">':completion:*:kill:*'</span> force-list always
zstyle <span style="color: #ff0000;">':completion:*:processes'</span> <span style="color: #7a0874; font-weight: bold;">command</span> <span style="color: #ff0000;">'ps -u $USER -o pid,%cpu,tty,cputime,cmd'</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># man</span>
zstyle <span style="color: #ff0000;">':completion:*:man:*'</span> separate-sections <span style="color: #c20cb9; font-weight: bold;">true</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># mutt</span>
<span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #660033;">-f</span> ~<span style="color: #000000; font-weight: bold;">/</span>.mutt<span style="color: #000000; font-weight: bold;">/</span>aliases <span style="color: #7a0874; font-weight: bold;">&#93;</span><span style="color: #7a0874; font-weight: bold;">&#93;</span>; <span style="color: #000000; font-weight: bold;">then</span>
    zstyle <span style="color: #ff0000;">':completion:*:*:mutt:*'</span> menu <span style="color: #c20cb9; font-weight: bold;">yes</span> <span style="color: #000000; font-weight: bold;">select</span>
    zstyle <span style="color: #ff0000;">':completion:*:mutt:*'</span> <span style="color: #c20cb9; font-weight: bold;">users</span> <span style="color: #800000;">${${${(f)&quot;$(&lt;~/.mutt/aliases)&quot;}</span><span style="color: #666666; font-style: italic;">#alias[[:space:]]}%%[[:space:]]*}</span>
<span style="color: #000000; font-weight: bold;">fi</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># mp3 players</span>
zstyle <span style="color: #ff0000;">':completion:*:*:mpg123:*'</span> file-patterns <span style="color: #ff0000;">'*.(mp3|MP3):mp3\ files *(-/):directories'</span>
zstyle <span style="color: #ff0000;">':completion:*:*:mpg321:*'</span> file-patterns <span style="color: #ff0000;">'*.(mp3|MP3):mp3\ files *(-/):directories'</span>
zstyle <span style="color: #ff0000;">':completion:*:*:ogg123:*'</span> file-patterns <span style="color: #ff0000;">'*.(ogg|OGG|flac):ogg\ files *(-/):directories'</span>
zstyle <span style="color: #ff0000;">':completion:*:*:mocp:*'</span> file-patterns <span style="color: #ff0000;">'*.(wav|WAV|mp3|MP3|ogg|OGG|flac):ogg\ files *(-/):directories'</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># ?</span>
zstyle <span style="color: #ff0000;">':completion::*:(-command-|export):*'</span> fake-parameters <span style="color: #800000;">${${${_comps[(I)-value-*]#*,}</span><span style="color: #000000; font-weight: bold;">%%</span>,<span style="color: #000000; font-weight: bold;">*</span><span style="color: #7a0874; font-weight: bold;">&#125;</span>:<span style="color: #666666; font-style: italic;">#-*-}</span>
zstyle <span style="color: #ff0000;">':completion:*:-tilde-:*'</span> group-order <span style="color: #ff0000;">'named-directories'</span> <span style="color: #ff0000;">'path-directories'</span> <span style="color: #ff0000;">'users'</span> <span style="color: #ff0000;">'expand'</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># ignore completion functions for commands you don't have</span>
zstyle <span style="color: #ff0000;">':completion:*:functions'</span> ignored-patterns <span style="color: #ff0000;">'(_*|pre(cmd|exec))'</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># Prevent CVS/SVN files/directories from being completed</span>
zstyle <span style="color: #ff0000;">':completion:*:(all-|)files'</span> ignored-patterns <span style="color: #ff0000;">'(|*/)CVS'</span>
zstyle <span style="color: #ff0000;">':completion:*:cd:*'</span> ignored-patterns <span style="color: #ff0000;">'(*/)#CVS'</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># Prevent lost+found directory from being completed</span>
zstyle <span style="color: #ff0000;">':completion:*:cd:*'</span> ignored-patterns <span style="color: #ff0000;">'(*/)#lost+found'</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># Ignore completion functions for commands you don't have:</span>
zstyle <span style="color: #ff0000;">':completion:*:functions'</span> ignored-patterns <span style="color: #ff0000;">'_*'</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># Ignore same file on rm</span>
zstyle <span style="color: #ff0000;">':completion:*:(rm|kill|diff):*'</span> ignore-line <span style="color: #c20cb9; font-weight: bold;">yes</span>
zstyle <span style="color: #ff0000;">':completion:*:rm:*'</span> file-patterns <span style="color: #ff0000;">'*:all-files'</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># Ignore all for mcd</span>
zstyle <span style="color: #ff0000;">':completion:*:mcd:*'</span> ignored-patterns <span style="color: #ff0000;">'*'</span>
zstyle <span style="color: #ff0000;">':completion:*:wine:*'</span> file-patterns <span style="color: #ff0000;">'*.(exe|EXE):exe'</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># add gnu default completions</span>
compdef _gnu_generic ctags
&nbsp;
<span style="color: #666666; font-style: italic;"># automagic url quoter</span>
autoload <span style="color: #660033;">-U</span> url-quote-magic
zle <span style="color: #660033;">-N</span> self-insert url-quote-magic
&nbsp;
<span style="color: #666666; font-style: italic;"># ENV</span>
<span style="color: #007800;">fpath</span>=<span style="color: #7a0874; font-weight: bold;">&#40;</span>
	<span style="color: #007800;">$zdotdir</span><span style="color: #000000; font-weight: bold;">/</span><span style="color: #7a0874; font-weight: bold;">&#123;</span>.<span style="color: #7a0874; font-weight: bold;">&#91;</span>z<span style="color: #7a0874; font-weight: bold;">&#93;</span>sh<span style="color: #000000; font-weight: bold;">/*</span>.zwc,<span style="color: #7a0874; font-weight: bold;">&#123;</span>.<span style="color: #7a0874; font-weight: bold;">&#91;</span>z<span style="color: #7a0874; font-weight: bold;">&#93;</span><span style="color: #c20cb9; font-weight: bold;">sh</span>,<span style="color: #7a0874; font-weight: bold;">&#91;</span>l<span style="color: #7a0874; font-weight: bold;">&#93;</span>ib<span style="color: #000000; font-weight: bold;">/</span><span style="color: #c20cb9; font-weight: bold;">zsh</span><span style="color: #7a0874; font-weight: bold;">&#125;</span><span style="color: #000000; font-weight: bold;">/</span><span style="color: #7a0874; font-weight: bold;">&#123;</span>functions,scripts<span style="color: #7a0874; font-weight: bold;">&#125;</span><span style="color: #7a0874; font-weight: bold;">&#125;</span><span style="color: #7a0874; font-weight: bold;">&#40;</span>N<span style="color: #7a0874; font-weight: bold;">&#41;</span>
	<span style="color: #007800;">$fpath</span>
	<span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>share<span style="color: #000000; font-weight: bold;">/</span>zsh<span style="color: #000000; font-weight: bold;">/</span><span style="color: #800000;">${ZSH_VERSION}</span><span style="color: #000000; font-weight: bold;">/</span><span style="color: #7a0874; font-weight: bold;">&#91;</span>F<span style="color: #7a0874; font-weight: bold;">&#93;</span>unctions<span style="color: #7a0874; font-weight: bold;">&#40;</span>N<span style="color: #7a0874; font-weight: bold;">&#41;</span>
<span style="color: #7a0874; font-weight: bold;">&#41;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">for</span> <span style="color: #c20cb9; font-weight: bold;">dirname</span> <span style="color: #000000; font-weight: bold;">in</span> <span style="color: #007800;">$fpath</span>; <span style="color: #000000; font-weight: bold;">do</span>
	<span style="color: #007800;">fns</span>=<span style="color: #7a0874; font-weight: bold;">&#40;</span> <span style="color: #007800;">$dirname</span><span style="color: #000000; font-weight: bold;">/*</span>-<span style="color: #000000; font-weight: bold;">*</span>-<span style="color: #7a0874; font-weight: bold;">&#40;</span>N.x:t<span style="color: #7a0874; font-weight: bold;">&#41;</span> <span style="color: #7a0874; font-weight: bold;">&#41;</span>
	<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #7a0874; font-weight: bold;">&#40;</span> <span style="color: #007800;">$#</span>fns <span style="color: #7a0874; font-weight: bold;">&#41;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span> <span style="color: #000000; font-weight: bold;">&amp;&amp;</span> autoload <span style="color: #ff0000;">&quot;<span style="color: #007800;">$fns</span>[@]&quot;</span>
<span style="color: #000000; font-weight: bold;">done</span>
<span style="color: #7a0874; font-weight: bold;">typeset</span> <span style="color: #660033;">-gU</span> fpath
&nbsp;
freload <span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span> <span style="color: #7a0874; font-weight: bold;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">while</span> <span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #7a0874; font-weight: bold;">&#40;</span> <span style="color: #007800;">$#</span> <span style="color: #7a0874; font-weight: bold;">&#41;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>; <span style="color: #000000; font-weight: bold;">do</span>
		unfunction $<span style="color: #000000;">1</span>;
		autoload <span style="color: #660033;">-U</span> $<span style="color: #000000;">1</span>;
		<span style="color: #7a0874; font-weight: bold;">shift</span>;
	<span style="color: #000000; font-weight: bold;">done</span>
<span style="color: #7a0874; font-weight: bold;">&#125;</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># For those times when we may get confused =]</span>
setenv <span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span> <span style="color: #7a0874; font-weight: bold;">&#123;</span>
	<span style="color: #7a0874; font-weight: bold;">typeset</span> <span style="color: #660033;">-x</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">${1}</span><span style="color: #007800;">${1:+=}</span><span style="color: #007800;">${(@)argv[2,$#]}</span>&quot;</span>
<span style="color: #7a0874; font-weight: bold;">&#125;</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># OS specific stuff for different systems I work on.</span>
<span style="color: #000000; font-weight: bold;">case</span> <span style="color: #000000; font-weight: bold;">`</span><span style="color: #c20cb9; font-weight: bold;">uname</span><span style="color: #000000; font-weight: bold;">`</span> <span style="color: #000000; font-weight: bold;">in</span>
	FreeBSD<span style="color: #7a0874; font-weight: bold;">&#41;</span>
		<span style="color: #007800;">LSCOLORS</span>=<span style="color: #ff0000;">&quot;ExFxcxdxbxEgababagacad&quot;</span>
		<span style="color: #000000; font-weight: bold;">;;</span>
	NetBSD<span style="color: #7a0874; font-weight: bold;">&#41;</span>
		<span style="color: #007800;">manpath</span>=<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #007800;">$manpath</span> <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>pkg<span style="color: #000000; font-weight: bold;">/</span><span style="color: #c20cb9; font-weight: bold;">man</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>; <span style="color: #7a0874; font-weight: bold;">export</span> MANPATH
		<span style="color: #000000; font-weight: bold;">;;</span>
	Darwin<span style="color: #7a0874; font-weight: bold;">&#41;</span>
		<span style="color: #007800;">LSCOLORS</span>=<span style="color: #ff0000;">&quot;ExFxcxdxbxEgababagacad&quot;</span>
		<span style="color: #000000; font-weight: bold;">;;</span>
	Linux<span style="color: #7a0874; font-weight: bold;">&#41;</span>
		<span style="color: #007800;">manpath</span>=<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #007800;">$manpath</span> <span style="color: #000000; font-weight: bold;">/</span>opt<span style="color: #000000; font-weight: bold;">/</span><span style="color: #c20cb9; font-weight: bold;">man</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>; <span style="color: #7a0874; font-weight: bold;">export</span> MANPATH
		<span style="color: #000000; font-weight: bold;">;;</span>
	<span style="color: #000000; font-weight: bold;">*</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>
		<span style="color: #000000; font-weight: bold;">;;</span>
<span style="color: #000000; font-weight: bold;">esac</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># Manual page paths</span>
setopt ALL_EXPORT
<span style="color: #007800;">manpath</span>=<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span><span style="color: #c20cb9; font-weight: bold;">man</span> <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>local<span style="color: #000000; font-weight: bold;">/</span><span style="color: #c20cb9; font-weight: bold;">man</span> <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>share<span style="color: #000000; font-weight: bold;">/</span><span style="color: #c20cb9; font-weight: bold;">man</span> <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>local<span style="color: #000000; font-weight: bold;">/</span>share<span style="color: #000000; font-weight: bold;">/</span><span style="color: #c20cb9; font-weight: bold;">man</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># Automatically remove duplicates from these arrays</span>
<span style="color: #7a0874; font-weight: bold;">typeset</span> <span style="color: #660033;">-U</span> path cdpath fpath manpath
&nbsp;
<span style="color: #666666; font-style: italic;"># History</span>
<span style="color: #007800;">HISTFILE</span>=<span style="color: #800000;">${HOME}</span><span style="color: #000000; font-weight: bold;">/</span>.zhistory
<span style="color: #007800;">HISTSIZE</span>=<span style="color: #000000;">3000</span> <span style="color: #666666; font-style: italic;"># huge hist file</span>
<span style="color: #007800;">SAVEHIST</span>=<span style="color: #000000;">3000</span>
<span style="color: #007800;">DIRSTACKSIZE</span>=<span style="color: #000000;">20</span> <span style="color: #666666; font-style: italic;"># rarely need more than that</span>
<span style="color: #007800;">PATH</span>=<span style="color: #000000; font-weight: bold;">/</span>sbin:<span style="color: #000000; font-weight: bold;">/</span>bin:<span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>sbin:<span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>bin:<span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>local<span style="color: #000000; font-weight: bold;">/</span>bin:<span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>local<span style="color: #000000; font-weight: bold;">/</span>sbin:<span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>X11R6<span style="color: #000000; font-weight: bold;">/</span>bin:<span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>games:<span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>lib<span style="color: #000000; font-weight: bold;">/</span>surfraw:<span style="color: #000000; font-weight: bold;">/</span>opt<span style="color: #000000; font-weight: bold;">/</span>kde<span style="color: #000000; font-weight: bold;">/</span>bin:<span style="color: #000000; font-weight: bold;">/</span>opt<span style="color: #000000; font-weight: bold;">/</span>java<span style="color: #000000; font-weight: bold;">/</span>bin:<span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>lib<span style="color: #000000; font-weight: bold;">/</span>git-core
<span style="color: #007800;">HOSTNAME</span>=<span style="color: #000000; font-weight: bold;">`</span><span style="color: #c20cb9; font-weight: bold;">hostname</span><span style="color: #000000; font-weight: bold;">`</span>
<span style="color: #007800;">BROWSER</span>=<span style="color: #ff0000;">&quot;/usr/bin/firefox&quot;</span>
<span style="color: #007800;">PAGER</span>=<span style="color: #c20cb9; font-weight: bold;">less</span>
<span style="color: #007800;">LESS</span>=<span style="color: #ff0000;">'-RMS'</span>
<span style="color: #007800;">EDITOR</span>=<span style="color: #ff0000;">&quot;vim&quot;</span>
<span style="color: #666666; font-style: italic;"># Colorize STDERR red, from gentoowiki</span>
<span style="color: #666666; font-style: italic;">#exec 2&gt;&gt;(while read line; do print '\e[91m'${(q)line}'\e[0m' &gt; /dev/tty; done &amp;)</span>
<span style="color: #666666; font-style: italic;"># setup a bunch of fancy colors</span>
<span style="color: #007800;">DARCS_ALWAYS_COLOR</span>=<span style="color: #000000;">1</span>
<span style="color: #007800;">DARCS_DO_COLOR_LINES</span>=<span style="color: #000000;">1</span>
<span style="color: #007800;">LS_COLORS</span>=<span style="color: #ff0000;">'no=00:fi=00:di=01;34:ln=01;36:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:su=37;41:sg=30;43:tw=30;42:ow=34;42:st=37;44:ex=01;32:*.tar=01;31:*.tgz=01;31:*.svgz=01;31:*.arj=01;31:*.taz=01;31:*.lzh=01;31:*.lzma=01;31:*.zip=01;31:*.z=01;31:*.Z=01;31:*.dz=01;31:*.gz=01;31:*.bz2=01;31:*.bz=01;31:*.tbz2=01;31:*.tz=01;31:*.deb=01;31:*.rpm=01;31:*.jar=01;31:*.rar=01;31:*.ace=01;31:*.zoo=01;31:*.cpio=01;31:*.7z=01;31:*.rz=01;31:*.jpg=01;35:*.jpeg=01;35:*.gif=01;35:*.bmp=01;35:*.pbm=01;35:*.pgm=01;35:*.ppm=01;35:*.tga=01;35:*.xbm=01;35:*.xpm=01;35:*.tif=01;35:*.tiff=01;35:*.png=01;35:*.svg=01;35:*.mng=01;35:*.pcx=01;35:*.mov=01;35:*.mpg=01;35:*.mpeg=01;35:*.m2v=01;35:*.mkv=01;35:*.ogm=01;35:*.mp4=01;35:*.m4v=01;35:*.mp4v=01;35:*.vob=01;35:*.qt=01;35:*.nuv=01;35:*.wmv=01;35:*.asf=01;35:*.rm=01;35:*.rmvb=01;35:*.flc=01;35:*.avi=01;35:*.fli=01;35:*.gl=01;35:*.dl=01;35:*.xcf=01;35:*.xwd=01;35:*.yuv=01;35:*.aac=00;36:*.au=00;36:*.flac=00;36:*.mid=00;36:*.midi=00;36:*.mka=00;36:*.mp3=00;36:*.mpc=00;36:*.ogg=00;36:*.ra=00;36:*.wav=00;36:'</span>;
<span style="color: #007800;">ZLS_COLORS</span>=<span style="color: #007800;">$LS_COLORS</span>
<span style="color: #007800;">GREP_COLOR</span>=<span style="color: #ff0000;">'1;32'</span> <span style="color: #666666; font-style: italic;">#bright green</span>
<span style="color: #007800;">GREP_OPTIONS</span>=<span style="color: #ff0000;">'--color=auto'</span>
<span style="color: #007800;">CVS_RSH</span>=<span style="color: #c20cb9; font-weight: bold;">ssh</span>
<span style="color: #007800;">LANGUAGE</span>=
<span style="color: #007800;">LC_ALL</span>=en_US.UTF-<span style="color: #000000;">8</span>
<span style="color: #007800;">LANG</span>=en_US.UTF-<span style="color: #000000;">8</span>
<span style="color: #007800;">LESS_TERMCAP_mb</span>=$<span style="color: #ff0000;">'\E[01;31m'</span>
<span style="color: #007800;">LESS_TERMCAP_md</span>=$<span style="color: #ff0000;">'\E[01;31m'</span>
<span style="color: #007800;">LESS_TERMCAP_me</span>=$<span style="color: #ff0000;">'\E[0m'</span>
<span style="color: #007800;">LESS_TERMCAP_se</span>=$<span style="color: #ff0000;">'\E[0m'</span>                           
<span style="color: #007800;">LESS_TERMCAP_so</span>=$<span style="color: #ff0000;">'\E[01;44;33m'</span>                                 
<span style="color: #007800;">LESS_TERMCAP_ue</span>=$<span style="color: #ff0000;">'\E[0m'</span>
<span style="color: #007800;">LESS_TERMCAP_us</span>=$<span style="color: #ff0000;">'\E[01;32m'</span>
unsetopt ALL_EXPORT
&nbsp;
<span style="color: #666666; font-style: italic;"># User defined functions</span>
extract<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span> <span style="color: #7a0874; font-weight: bold;">&#123;</span>
    <span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #660033;">-f</span> $<span style="color: #000000;">1</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span>; <span style="color: #000000; font-weight: bold;">then</span>
        <span style="color: #000000; font-weight: bold;">case</span> $<span style="color: #000000;">1</span> <span style="color: #000000; font-weight: bold;">in</span>
            <span style="color: #000000; font-weight: bold;">*</span>.tar.bz2<span style="color: #7a0874; font-weight: bold;">&#41;</span>      <span style="color: #c20cb9; font-weight: bold;">tar</span> xjvf $<span style="color: #000000;">1</span>     <span style="color: #000000; font-weight: bold;">;;</span>
            <span style="color: #000000; font-weight: bold;">*</span>.tar.gz<span style="color: #7a0874; font-weight: bold;">&#41;</span>       <span style="color: #c20cb9; font-weight: bold;">tar</span> xzvf $<span style="color: #000000;">1</span>     <span style="color: #000000; font-weight: bold;">;;</span>
            <span style="color: #000000; font-weight: bold;">*</span>.tgz<span style="color: #7a0874; font-weight: bold;">&#41;</span>          <span style="color: #c20cb9; font-weight: bold;">tar</span> xzvf $<span style="color: #000000;">1</span>     <span style="color: #000000; font-weight: bold;">;;</span>
            <span style="color: #000000; font-weight: bold;">*</span>.bz2<span style="color: #7a0874; font-weight: bold;">&#41;</span>          <span style="color: #c20cb9; font-weight: bold;">bzip2</span> <span style="color: #660033;">-d</span> $<span style="color: #000000;">1</span>     <span style="color: #000000; font-weight: bold;">;;</span>
            <span style="color: #000000; font-weight: bold;">*</span>.gz<span style="color: #7a0874; font-weight: bold;">&#41;</span>           <span style="color: #c20cb9; font-weight: bold;">gunzip</span> <span style="color: #660033;">-d</span> $<span style="color: #000000;">1</span>    <span style="color: #000000; font-weight: bold;">;;</span>
            <span style="color: #000000; font-weight: bold;">*</span>.tar<span style="color: #7a0874; font-weight: bold;">&#41;</span>          <span style="color: #c20cb9; font-weight: bold;">tar</span> xvf $<span style="color: #000000;">1</span>      <span style="color: #000000; font-weight: bold;">;;</span>
            <span style="color: #000000; font-weight: bold;">*</span>.zip<span style="color: #7a0874; font-weight: bold;">&#41;</span>          <span style="color: #c20cb9; font-weight: bold;">unzip</span> $<span style="color: #000000;">1</span>        <span style="color: #000000; font-weight: bold;">;;</span>
            <span style="color: #000000; font-weight: bold;">*</span>.Z<span style="color: #7a0874; font-weight: bold;">&#41;</span>            uncompress $<span style="color: #000000;">1</span>   <span style="color: #000000; font-weight: bold;">;;</span>
            <span style="color: #000000; font-weight: bold;">*</span>.rar<span style="color: #7a0874; font-weight: bold;">&#41;</span>          unrar x $<span style="color: #000000;">1</span>      <span style="color: #000000; font-weight: bold;">;;</span>
            <span style="color: #000000; font-weight: bold;">*</span>.7z<span style="color: #7a0874; font-weight: bold;">&#41;</span>           7z x $<span style="color: #000000;">1</span>         <span style="color: #000000; font-weight: bold;">;;</span>
            <span style="color: #000000; font-weight: bold;">*</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>              <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;'$1' Error. I have no idea what to do with that&quot;</span><span style="color: #000000; font-weight: bold;">;;</span>
        <span style="color: #000000; font-weight: bold;">esac</span>
    <span style="color: #000000; font-weight: bold;">else</span>
        <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;'$1' is not a valid file&quot;</span>
    <span style="color: #000000; font-weight: bold;">fi</span>
<span style="color: #7a0874; font-weight: bold;">&#125;</span>
&nbsp;
lsarchive<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span> <span style="color: #7a0874; font-weight: bold;">&#123;</span>
    <span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #660033;">-f</span> $<span style="color: #000000;">1</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span>; <span style="color: #000000; font-weight: bold;">then</span>
        <span style="color: #000000; font-weight: bold;">case</span> $<span style="color: #000000;">1</span> <span style="color: #000000; font-weight: bold;">in</span>
            <span style="color: #000000; font-weight: bold;">*</span>.tar.bz2<span style="color: #7a0874; font-weight: bold;">&#41;</span>      <span style="color: #c20cb9; font-weight: bold;">tar</span> jtf $<span style="color: #000000;">1</span>      <span style="color: #000000; font-weight: bold;">;;</span>
            <span style="color: #000000; font-weight: bold;">*</span>.tar.gz<span style="color: #7a0874; font-weight: bold;">&#41;</span>       <span style="color: #c20cb9; font-weight: bold;">tar</span> ztf $<span style="color: #000000;">1</span>      <span style="color: #000000; font-weight: bold;">;;</span>
            <span style="color: #000000; font-weight: bold;">*</span>.tar<span style="color: #7a0874; font-weight: bold;">&#41;</span>          <span style="color: #c20cb9; font-weight: bold;">tar</span> tf $<span style="color: #000000;">1</span>       <span style="color: #000000; font-weight: bold;">;;</span>
            <span style="color: #000000; font-weight: bold;">*</span>.tgz<span style="color: #7a0874; font-weight: bold;">&#41;</span>          <span style="color: #c20cb9; font-weight: bold;">tar</span> ztf $<span style="color: #000000;">1</span>      <span style="color: #000000; font-weight: bold;">;;</span>
            <span style="color: #000000; font-weight: bold;">*</span>.zip<span style="color: #7a0874; font-weight: bold;">&#41;</span>          <span style="color: #c20cb9; font-weight: bold;">unzip</span> <span style="color: #660033;">-l</span> $<span style="color: #000000;">1</span>     <span style="color: #000000; font-weight: bold;">;;</span>
            <span style="color: #000000; font-weight: bold;">*</span>.rar<span style="color: #7a0874; font-weight: bold;">&#41;</span>          rar vb $<span style="color: #000000;">1</span>       <span style="color: #000000; font-weight: bold;">;;</span>
            <span style="color: #000000; font-weight: bold;">*</span>.7z<span style="color: #7a0874; font-weight: bold;">&#41;</span>           7z l $<span style="color: #000000;">1</span>         <span style="color: #000000; font-weight: bold;">;;</span>
            <span style="color: #000000; font-weight: bold;">*</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>              <span style="color: #7a0874; font-weight: bold;">echo</span><span style="color: #ff0000;">&quot;'$1' Error. I have no idea what to do with that&quot;</span><span style="color: #000000; font-weight: bold;">;;</span>
        <span style="color: #000000; font-weight: bold;">esac</span>
    <span style="color: #000000; font-weight: bold;">else</span>
        <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;'$1' is not a valid archive&quot;</span>
    <span style="color: #000000; font-weight: bold;">fi</span>
<span style="color: #7a0874; font-weight: bold;">&#125;</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># quick dir change function</span>
rationalize-dot<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span> <span style="color: #7a0874; font-weight: bold;">&#123;</span>
    <span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #007800;">$LBUFFER</span> = <span style="color: #000000; font-weight: bold;">*</span>.. <span style="color: #7a0874; font-weight: bold;">&#93;</span><span style="color: #7a0874; font-weight: bold;">&#93;</span>; <span style="color: #000000; font-weight: bold;">then</span>
        LBUFFER+=<span style="color: #000000; font-weight: bold;">/</span>..
    <span style="color: #000000; font-weight: bold;">else</span>
        LBUFFER+=.
    <span style="color: #000000; font-weight: bold;">fi</span>
<span style="color: #7a0874; font-weight: bold;">&#125;</span>
zle <span style="color: #660033;">-N</span> rationalize-dot
bindkey . rationalize-dot
&nbsp;
<span style="color: #666666; font-style: italic;"># Set up prompt</span>
<span style="color: #666666; font-style: italic;">#source $HOME/.zsh/prompt.phil</span>
<span style="color: #7a0874; font-weight: bold;">source</span> <span style="color: #007800;">$HOME</span><span style="color: #000000; font-weight: bold;">/</span>.zsh<span style="color: #000000; font-weight: bold;">/</span>prompt.aaron</pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://www.webframp.com/2009/09/17/by-request-zsh-config/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Xmonad and Xmonad-contrib documentation</title>
		<link>http://www.webframp.com/2009/07/02/xmonad-and-xmonad-contrib-documentation/</link>
		<comments>http://www.webframp.com/2009/07/02/xmonad-and-xmonad-contrib-documentation/#comments</comments>
		<pubDate>Thu, 02 Jul 2009 17:52:03 +0000</pubDate>
		<dc:creator>sean</dc:creator>
				<category><![CDATA[xmonad]]></category>

		<guid isPermaLink="false">http://www.webframp.com/?p=142</guid>
		<description><![CDATA[For personal reference, I keep haddock docs for darcs versions of xmonad and xmonad-contrib on this site.
It&#8217;s easy enough to build using:
$ cabal haddock
but if you don&#8217;t want to do that for any reason:

xmonad
xmonad-contrib

]]></description>
			<content:encoded><![CDATA[<p>For personal reference, I keep haddock docs for darcs versions of <a href="http://www.xmonad.org/">xmonad</a> and xmonad-contrib on this site.</p>
<p>It&#8217;s easy enough to build using:</p>
<p><code>$ cabal haddock</code></p>
<p>but if you don&#8217;t want to do that for any reason:</p>
<ul>
<li><a href="http://www.webframp.com/doc/html/xmonad/">xmonad</a></li>
<li><a href="http://www.webframp.com/doc/html/xmonad-contrib/">xmonad-contrib</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.webframp.com/2009/07/02/xmonad-and-xmonad-contrib-documentation/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Offlineimap + mutt + gmail + msmtp = crazy delicious email</title>
		<link>http://www.webframp.com/2009/06/17/offlineimap-mutt-gmail-msmtp-crazy-delicious-email/</link>
		<comments>http://www.webframp.com/2009/06/17/offlineimap-mutt-gmail-msmtp-crazy-delicious-email/#comments</comments>
		<pubDate>Thu, 18 Jun 2009 06:43:18 +0000</pubDate>
		<dc:creator>sean</dc:creator>
				<category><![CDATA[musings]]></category>

		<guid isPermaLink="false">http://www.webframp.com/?p=136</guid>
		<description><![CDATA[I&#8217;ve finally settled on the best email setup I&#8217;ve had since the fetchmail+procmail+mutt setup I used several years ago. It&#8217;s not much different and still allows me to use my absolute favorite email client, mutt. &#8220;Offlineimap is a tool to simplify your email reading&#8221; says the homepage for this deceptively simple program. With offlineimap I [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve finally settled on the best email setup I&#8217;ve had since the fetchmail+procmail+mutt setup I used several years ago. It&#8217;s not much different and still allows me to use my absolute favorite email client, <a href="http://www.mutt.org">mutt</a>. &#8220;<a href="http://software.complete.org/software/projects/show/offlineimap">Offlineimap</a> is a tool to simplify your email reading&#8221; says the homepage for this deceptively simple program. With offlineimap I now have a backup of all the messages in my gmail account, mutt performance is improved (it&#8217;s much better at Maildir than direct imap access), and have synchronized my mail reading on 3 different machines.</p>
<p>So here&#8217;s the basics.</p>
<p><strong>.offlineimaprc:</strong></p>

<div class="wp_syntax"><div class="code"><pre class="dos" style="font-family:monospace;"><span style="color: #66cc66;">&#91;</span>general<span style="color: #66cc66;">&#93;</span>
metadata = ~/.offlineimap
accounts = GmailMain
ui = Noninteractive.Quiet
&nbsp;
<span style="color: #66cc66;">&#91;</span>mbnames<span style="color: #66cc66;">&#93;</span>
enabled = yes
filename = ~/.mutt/muttrc.mailboxes
header = &quot;mailboxes &quot;
peritem = =<span style="color: #33cc33;">%</span><span style="color: #66cc66;">&#40;</span>foldername<span style="color: #66cc66;">&#41;</span>s
sep = &quot; &quot;
footer = &quot;\n&quot;
&nbsp;
<span style="color: #66cc66;">&#91;</span>Account GmailMain<span style="color: #66cc66;">&#93;</span>
localrepository = GmailLocal
<span style="color: #808080; font-style: italic;">remoterepository = GmailRemote</span>
&nbsp;
<span style="color: #66cc66;">&#91;</span>Repository GmailLocal<span style="color: #66cc66;">&#93;</span>
type = Maildir
localfolders = ~/.mail/GMAIL
&nbsp;
<span style="color: #66cc66;">&#91;</span>Repository GmailRemote<span style="color: #66cc66;">&#93;</span>
type = Gmail
<span style="color: #808080; font-style: italic;">remoteuser = yourname@gmail.com</span>
<span style="color: #808080; font-style: italic;">remotepassfile = ~/.mailpass</span></pre></div></div>

<p><strong>.msmtprc:</strong></p>

<div class="wp_syntax"><div class="code"><pre class="dos" style="font-family:monospace;">account default
host smtp.gmail.com
port <span style="color: #cc66cc;">587</span>
from yourname<span style="color: #33cc33;">@</span>gmail.com
tls on
tls_starttls on
# you can google on how to find this
tls_trust_file /home/webframp/.mutt/certs/Thawte_Premium_Server_CA.pem
auth on
user yourname
password yourpassword
logfile ~/.msmtp.log</pre></div></div>

<p><strong>relevant bits of .muttrc:</strong></p>

<div class="wp_syntax"><div class="code"><pre class="dos" style="font-family:monospace;"><span style="color: #b1b100; font-weight: bold;">set</span> <span style="color: #448844;">mbox_type</span>=Maildir                                   # mailbox type
<span style="color: #b1b100; font-weight: bold;">set</span> <span style="color: #448844;">hostname</span>=gmail.com                                  # This is my domain.
&nbsp;
# GMAIL+OFFLINEIMAP settings
<span style="color: #b1b100; font-weight: bold;">set</span> <span style="color: #448844;">imap_user</span>=sean.escriva<span style="color: #33cc33;">@</span>gmail.com
<span style="color: #b1b100; font-weight: bold;">set</span> <span style="color: #448844;">folder</span>=$HOME/.mail/GMAIL
<span style="color: #b1b100; font-weight: bold;">set</span> <span style="color: #448844;">spoolfile</span>=+/INBOX
<span style="color: #b1b100; font-weight: bold;">set</span> <span style="color: #448844;">postponed</span>=&quot;+<span style="color: #66cc66;">&#91;</span>GMAIL<span style="color: #66cc66;">&#93;</span>.Drafts&quot;
<span style="color: #b1b100; font-weight: bold;">set</span> <span style="color: #448844;">record</span>=&quot;+<span style="color: #66cc66;">&#91;</span>GMAIL<span style="color: #66cc66;">&#93;</span>.Sent Mail&quot;
&nbsp;
# Mailboxes via offlineimap
source $HOME/.mutt/muttrc.mailboxes
&nbsp;
<span style="color: #b1b100; font-weight: bold;">set</span> <span style="color: #448844;">sendmail</span>=&quot;/usr/bin/msmtp&quot;               # Sendmail alternative</pre></div></div>

<p>I find running offlineimap via my crontab provides a nice solution to that<br />
compulsive mail check impulse that can easily develop. Of course I also have a<br />
Maildir check in my dzen xmonad statusbar using the ppExtras setting of my<br />
pretty printer:</p>

<div class="wp_syntax"><div class="code"><pre class="haskell" style="font-family:monospace;"><span style="color: #339933; font-weight: bold;">...</span>
  <span style="color: #339933; font-weight: bold;">,</span> ppExtras <span style="color: #339933; font-weight: bold;">=</span> <span style="color: green;">&#91;</span>logMail<span style="color: green;">&#93;</span>
  <span style="color: green;">&#125;</span>
<span style="color: #06c; font-weight: bold;">where</span>
 logMail <span style="color: #339933; font-weight: bold;">=</span> dzenColorL colorPink <span style="background-color: #3cb371;">&quot;&quot;</span> <span style="color: #339933; font-weight: bold;">.</span> wrapL mailIcon <span style="background-color: #3cb371;">&quot;&quot;</span><span style="color: #339933; font-weight: bold;">.</span> padL <span style="color: #339933; font-weight: bold;">$</span> maildirNew mailDir
 mailIcon <span style="color: #339933; font-weight: bold;">=</span> <span style="background-color: #3cb371;">&quot;^i(/home/webframp/.dzen/icons/dzen_bitmaps/envelope.xbm)&quot;</span>
 mailDir <span style="color: #339933; font-weight: bold;">=</span> <span style="background-color: #3cb371;">&quot;/home/webframp/.mail/GMAIL/INBOX&quot;</span></pre></div></div>

<p>Maybe you can glean something useful from my setup</p>
]]></content:encoded>
			<wfw:commentRss>http://www.webframp.com/2009/06/17/offlineimap-mutt-gmail-msmtp-crazy-delicious-email/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Why Haskell is a joy to learn</title>
		<link>http://www.webframp.com/2009/04/15/why-haskell-is-a-joy-to-learn/</link>
		<comments>http://www.webframp.com/2009/04/15/why-haskell-is-a-joy-to-learn/#comments</comments>
		<pubDate>Thu, 16 Apr 2009 02:04:32 +0000</pubDate>
		<dc:creator>sean</dc:creator>
				<category><![CDATA[musings]]></category>
		<category><![CDATA[haskell]]></category>
		<category><![CDATA[programming]]></category>

		<guid isPermaLink="false">http://www.webframp.com/?p=119</guid>
		<description><![CDATA[I recently discovered Project Euler, an excellent resource to use while learning a new language. Maybe a little late to the game, but fun nonetheless.
The very first problem is rather simple:
If we list all the natural numbers below 10 that are multiples of 3 or 5, we get 3, 5, 6 and 9. The sum [...]]]></description>
			<content:encoded><![CDATA[<p>I recently discovered <a href="http://projecteuler.net/">Project Euler</a>, an excellent resource to use while learning a new language. Maybe a little late to the game, but fun nonetheless.</p>
<p>The very first <a href="http://projecteuler.net/index.php?section=problems&#038;id=1">problem</a> is rather simple:</p>
<blockquote><p>If we list all the natural numbers below 10 that are multiples of 3 or 5, we get 3, 5, 6 and 9. The sum of these multiples is 23.</p>
<p>Find the sum of all the multiples of 3 or 5 below 1000.</p></blockquote>
<p>And a potential solution is haskell is could be to define the following:</p>

<div class="wp_syntax"><div class="code"><pre class="haskell" style="font-family:monospace;">isMultOf x n <span style="color: #339933; font-weight: bold;">=</span> <span style="font-weight: bold;">mod</span> n x <span style="color: #339933; font-weight: bold;">==</span> <span style="color: red;">0</span>
&nbsp;
sumList xs <span style="color: #339933; font-weight: bold;">=</span> <span style="font-weight: bold;">foldr</span> <span style="color: green;">&#40;</span><span style="color: #339933; font-weight: bold;">+</span><span style="color: green;">&#41;</span> <span style="color: red;">0</span> xs</pre></div></div>

<p>After which the answer could be obtained with a simple:</p>

<div class="wp_syntax"><div class="code"><pre class="haskell" style="font-family:monospace;">sumList <span style="color: green;">&#91;</span>a <span style="color: #339933; font-weight: bold;">|</span> a <span style="color: #339933; font-weight: bold;">&lt;-</span> <span style="color: green;">&#91;</span>1<span style="color: #339933; font-weight: bold;">..</span>1000<span style="color: green;">&#93;</span><span style="color: #339933; font-weight: bold;">,</span> isMultOf <span style="color: red;">3</span> a <span style="color: #339933; font-weight: bold;">||</span> 
                             isMultOf <span style="color: red;">5</span> a<span style="color: #339933; font-weight: bold;">,</span> 
                             a <span style="color: #339933; font-weight: bold;">&lt;</span> <span style="color: red;">1000</span><span style="color: green;">&#93;</span></pre></div></div>

<p>And we have a list comprehension. Beautiful, and immediately expressive of exactly what&#8217;s happening for such a simple problem. The amazing thing is that properly written haskell maintains this same clarity and expressivity in even large scale programs. Sometimes it&#8217;s the little things in a language that makes you really appreciate it.</p>
<p>Hopefully wordpress hasn&#8217;t screwed up the formatting for you.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.webframp.com/2009/04/15/why-haskell-is-a-joy-to-learn/feed/</wfw:commentRss>
		<slash:comments>14</slash:comments>
		</item>
		<item>
		<title>A Few Xmonad Layout Examples</title>
		<link>http://www.webframp.com/2009/01/06/xmonad-layout-gallery/</link>
		<comments>http://www.webframp.com/2009/01/06/xmonad-layout-gallery/#comments</comments>
		<pubDate>Tue, 06 Jan 2009 22:38:18 +0000</pubDate>
		<dc:creator>sean</dc:creator>
				<category><![CDATA[*nix]]></category>
		<category><![CDATA[xmonad]]></category>

		<guid isPermaLink="false">http://www.webframp.com/?p=74</guid>
		<description><![CDATA[Every once in a while in #xmonad someone will ask for examples of some of the available layouts for xmonad or if there exists a layout gallery of sorts. There isn&#8217;t. I thought perhaps it would be useful to have a few examples of some of the common, and not so common, layouts that one [...]]]></description>
			<content:encoded><![CDATA[<p>Every once in a while in #xmonad someone will ask for examples of some of the available layouts for xmonad or if there exists a layout gallery of sorts. There isn&#8217;t. I thought perhaps it would be useful to have a few examples of some of the common, and not so common, layouts that one can use for xmonad. Regarding how to include these layouts in your configuration, read the docs on the <a title="extending Xmonad: Layouts" href="http://xmonad.org/xmonad-docs/xmonad-contrib/XMonad-Doc-Extending.html#5">LayoutHook</a></p>
<p>Clearly this can be expanded so if anyone would like to see more examples or has suggestions please let me know.</p>
<div class="ngg-galleryoverview" id="ngg-gallery-2-74">


	
	<!-- Thumbnails -->
		
	<div id="ngg-image-13" class="ngg-gallery-thumbnail-box"  >
		<div class="ngg-gallery-thumbnail" >
			<a href="http://www.webframp.com/nggallery/post/xmonad-layout-gallery/image/13" title="XMonad.Layout.Accordian --  LayoutClass that puts non-focused windows in ribbons at the top and bottom of the screen."  >
								<img title="Accordian 1920x1200" alt="Accordian 1920x1200" src="http://www.webframp.com/wp-content/gallery/xmonad-layouts/thumbs/thumbs_Accordian-1920x1200.png"  />
							</a>
		</div>
	</div>
	
		
 		
	<div id="ngg-image-14" class="ngg-gallery-thumbnail-box"  >
		<div class="ngg-gallery-thumbnail" >
			<a href="http://www.webframp.com/nggallery/post/xmonad-layout-gallery/image/14" title="XMonad.Layout.Circle -- elliptical, overlapping layout"  >
								<img title="Circle 1920x1200 " alt="Circle 1920x1200 " src="http://www.webframp.com/wp-content/gallery/xmonad-layouts/thumbs/thumbs_Circle-1920x1200.png"  />
							</a>
		</div>
	</div>
	
		
 		
	<div id="ngg-image-15" class="ngg-gallery-thumbnail-box"  >
		<div class="ngg-gallery-thumbnail" >
			<a href="http://www.webframp.com/nggallery/post/xmonad-layout-gallery/image/15" title="XMonad.Layout.DwmStyle -- layout modifier for decorating windows in a dwm like style"  >
								<img title="DwmStyle Tall 1920x1200" alt="DwmStyle Tall 1920x1200" src="http://www.webframp.com/wp-content/gallery/xmonad-layouts/thumbs/thumbs_DwmStyle-Tall-1920x1200.png"  />
							</a>
		</div>
	</div>
	
		
 		
	<div id="ngg-image-16" class="ngg-gallery-thumbnail-box"  >
		<div class="ngg-gallery-thumbnail" >
			<a href="http://www.webframp.com/nggallery/post/xmonad-layout-gallery/image/16" title="XMonad.Layout.Grid -- a gapless tile layout that attempts to put all windows in a square grid."  >
								<img title="Grid 1920x1200" alt="Grid 1920x1200" src="http://www.webframp.com/wp-content/gallery/xmonad-layouts/thumbs/thumbs_Grid-1920x1200.png"  />
							</a>
		</div>
	</div>
	
		
 		
	<div id="ngg-image-17" class="ngg-gallery-thumbnail-box"  >
		<div class="ngg-gallery-thumbnail" >
			<a href="http://www.webframp.com/nggallery/post/xmonad-layout-gallery/image/17" title="XMonad.Layout.IM -- layout modifier suitable for workspaces with multi-windows programs, such as gimp or pidgin. I don&amp;#039;t use pidgin, so the example is with gimp."  >
								<img title="IM Grid 1920x1200" alt="IM Grid 1920x1200" src="http://www.webframp.com/wp-content/gallery/xmonad-layouts/thumbs/thumbs_IM-Grid-1920x1200.png"  />
							</a>
		</div>
	</div>
	
		
 		
	<div id="ngg-image-18" class="ngg-gallery-thumbnail-box"  >
		<div class="ngg-gallery-thumbnail" >
			<a href="http://www.webframp.com/nggallery/post/xmonad-layout-gallery/image/18" title="XMonad.Layout.Magnifier -- Increases the size of the focused window"  >
								<img title="MagnifierGrid 1920x1200" alt="MagnifierGrid 1920x1200" src="http://www.webframp.com/wp-content/gallery/xmonad-layouts/thumbs/thumbs_MagnifierGrid-1920x1200.png"  />
							</a>
		</div>
	</div>
	
		
 		
	<div id="ngg-image-19" class="ngg-gallery-thumbnail-box"  >
		<div class="ngg-gallery-thumbnail" >
			<a href="http://www.webframp.com/nggallery/post/xmonad-layout-gallery/image/19" title="XMonad.Layout.MosaicAlt -- gives each window a specified amt of screen space relative to others"  >
								<img title="MosaicAlt 1920x1200" alt="MosaicAlt 1920x1200" src="http://www.webframp.com/wp-content/gallery/xmonad-layouts/thumbs/thumbs_MosaicAlt-1920x1200.png"  />
							</a>
		</div>
	</div>
	
		
 		
	<div id="ngg-image-20" class="ngg-gallery-thumbnail-box"  >
		<div class="ngg-gallery-thumbnail" >
			<a href="http://www.webframp.com/nggallery/post/xmonad-layout-gallery/image/20" title="XMonad.Layout.Roledex -- layout that behaves like Microsoft&amp;#039;s Flip 3D"  >
								<img title="Roledex 1920x1200" alt="Roledex 1920x1200" src="http://www.webframp.com/wp-content/gallery/xmonad-layouts/thumbs/thumbs_Roledex-1920x1200.png"  />
							</a>
		</div>
	</div>
	
		
 		
	<div id="ngg-image-21" class="ngg-gallery-thumbnail-box"  >
		<div class="ngg-gallery-thumbnail" >
			<a href="http://www.webframp.com/nggallery/post/xmonad-layout-gallery/image/21" title="XMonad.Layout.TabBarDecoration -- add a bar of tabs to your layouts. Here demonstrated with a Mirror Tall layout"  >
								<img title="TabBar Mirror Tall 1920x1200" alt="TabBar Mirror Tall 1920x1200" src="http://www.webframp.com/wp-content/gallery/xmonad-layouts/thumbs/thumbs_TabBarMirrorTall-1920x1200.png"  />
							</a>
		</div>
	</div>
	
		
 		
	<div id="ngg-image-22" class="ngg-gallery-thumbnail-box"  >
		<div class="ngg-gallery-thumbnail" >
			<a href="http://www.webframp.com/nggallery/post/xmonad-layout-gallery/image/22" title="XMonad.Layout.SimpleDecoration -- add simple decorations to the windows of a given layout, in the form of ion-like tabs for window titles."  >
								<img title="simpleDecoration Tall 1920x1200" alt="simpleDecoration Tall 1920x1200" src="http://www.webframp.com/wp-content/gallery/xmonad-layouts/thumbs/thumbs_simpleDecorationTall-1920x1200.png"  />
							</a>
		</div>
	</div>
	
		
 		
	<div id="ngg-image-23" class="ngg-gallery-thumbnail-box"  >
		<div class="ngg-gallery-thumbnail" >
			<a href="http://www.webframp.com/nggallery/post/xmonad-layout-gallery/image/23" title="XMonad.Layout.SimpleFloat -- basic floating layout"  >
								<img title="simpleFLoat 1920x1200" alt="simpleFLoat 1920x1200" src="http://www.webframp.com/wp-content/gallery/xmonad-layouts/thumbs/thumbs_simpleFLoat-1920x1200.png"  />
							</a>
		</div>
	</div>
	
		
 	 	
	<!-- Pagination -->
 	<div class='ngg-clear'></div>
 	
</div>

]]></content:encoded>
			<wfw:commentRss>http://www.webframp.com/2009/01/06/xmonad-layout-gallery/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>The Non-Intrusive User Interface</title>
		<link>http://www.webframp.com/2008/11/28/the-non-intrusive-user-interface/</link>
		<comments>http://www.webframp.com/2008/11/28/the-non-intrusive-user-interface/#comments</comments>
		<pubDate>Fri, 28 Nov 2008 23:55:51 +0000</pubDate>
		<dc:creator>sean</dc:creator>
				<category><![CDATA[*nix]]></category>
		<category><![CDATA[musings]]></category>
		<category><![CDATA[xmonad]]></category>
		<category><![CDATA[dzen]]></category>
		<category><![CDATA[haskell]]></category>
		<category><![CDATA[linux]]></category>

		<guid isPermaLink="false">http://www.webframp.com/?p=59</guid>
		<description><![CDATA[Technology as a whole should enable us. It should ease our daily tasks, offloading some of the burden, whether that be mental processing or physical expenditure. This should be especially true of computers our daily interactions bring us in contact with and more still when the bulk of our time is spent working with them. [...]]]></description>
			<content:encoded><![CDATA[<p>Technology as a whole should enable us. It should ease our daily tasks, offloading some of the burden, whether that be mental processing or physical expenditure. This should be especially true of computers our daily interactions bring us in contact with and more still when the bulk of our time is spent working with them. Personal computing should allow us to focus on a given task in a way that encourages us to accomplish more than we otherwise could. Every means of interaction within the system should support the task at hand with as little interference as possible.</p>
<p>Sadly this is not the state of computing for most users. The most popular <a title="Interface Metaphors" href="https://secure.wikimedia.org/wikipedia/en/wiki/Interface_metaphor">metaphors</a> in computing today &#8211; the desktop, the start menu, folders &#8211; and commonly learned ways of interacting with them &#8211; point and click with the mouse &#8211; actually discourage productivity and break concentration/focus from a task. The implementations of these ideas further this interruption. True most users now have been trained to reach for the mouse and their hand eye coordination is good enough to accomplish any given step within a reasonable time frame.</p>
<p>How though does the switch-tasking our brain does to accomplish these steps affect the flow of thought for the current project? Clearly the less divergent thoughts and less steps required for any single step, the less the thought process is diverted from the main task. Further while few people struggle to make the required movements with a mouse, what affect does the repetitive nature of the movement have on long term health and usage? No doubt anyone who uses a mouse on a daily basis for several hours has personally felt the strain on their wrist that naturally comes with such usage.</p>
<p>The modern computing user interface has become cluttered and distracting, albeit a composited, semi-transparent glossy distraction. The initial appeal of such common interface elements hides the distraction, disguises the intrusive elements. It&#8217;s as if the computer were telling you, &#8220;never mind this modal dialog that just interrupted your thought process, it&#8217;s so glossy it must be helpful&#8221;.</p>
<p>Consider the average means of launching a program. Is it really ideal to require the user to graphically navigate to some onscreen coordinate that receives instructions before thought is transferred to action? Doubtful. How much screen real estate is essentially wasted for interface elements that support this idea? And how much time is spent arranging or re-arranging the frequently less than ideal placement of windows within this paradigm? Most daily computer users quickly outgrow the nagging tedium of these interfaces, but have no option to adjust the defaults.</p>
<p>I personally prefer an interface that is minimal and stays out of the way. An interface that handles much of what we have come to think of as routine automatically. And one that is fully configurable and flexible enough to support interaction in the manner that works for best me. The <a title="Tiling Window Managers" href="https://secure.wikimedia.org/wikipedia/en/wiki/Tiling_window_manager">tiling window managers</a> available on Linux and specifically <a title="Xmonad" href="http://www.xmonad.org">Xmonad</a> support this beautifully.</p>
<p>With Xmonad window management is automatic. I do not have to think about window placement as every window is automatically arranged to take the best advantage of screen real estate based on simple rules that I have configured. I can call applications with a single keystroke and they appear exactly where and how I want them. I can send them away or bring them back to the current screen with little more than a gesture, not once having to remove my hands from their comfortable perch above the keyboard. Many applications do not play nicely with this idea though and try to force certain window behavior. For these few troublesome programs it a simple thing to always &#8220;float&#8221; them, so that they behave in much the same as with traditional window managers. All of it is easily configurable in <a title="Haskell" href="http://www.haskell.org">Haskell</a>, an advanced <a title="Functional programming" href="http://haskell.org/haskellwiki/Functional_programming">purely functional programming</a> language that is truly a joy to work with. Because of it concise syntax and clarity, I have been able to easily configure Xmonad to behave as I like, and it&#8217;s completely stable.</p>
<p>What is more, the means in which information is communicated is extremely configurable. I chose a minimal status bar using dzen, based on example <a title="dzen and Xmonad" href="http://dzen.geekmode.org/dwiki/doku.php?id=dzen:dzen-and-xmonad">scripts on the dzen wiki.</a> Information when, where, and how I want it.</p>
<p>I encourage everyone that is using Linux to try it. After just a short period of time, I&#8217;m sure you will agree that you are able to work in manner that is both non-intrusive and more productive.</p>
<ul>
<li><a title="My Xmonad configuration" href="http://haskell.org/haskellwiki/Xmonad/Config_archive/webframp%27s_xmonad.hs">My Xmonad configuration</a></li>
<li>A screenshot of the setup:</li>
<li><a href="http://haskell.org/sitewiki/images/1/14/Xmonad-desktop-webframp-scaled.jpg"><img class="alignnone" title="Xmonad Screenshot" src="http://haskell.org/sitewiki/images/1/14/Xmonad-desktop-webframp-scaled.jpg" alt="" width="455" height="170" /></a></li>
<li>
<p><div id="attachment_55" class="wp-caption alignnone" style="width: 110px"><a href="http://www.webframp.com/wp-content/uploads/2008/11/arch-xmonad-small.png"><img class="size-medium wp-image-55" title="arch-xmonad-small" src="http://www.webframp.com/wp-content/uploads/2008/11/arch-xmonad-small.png" alt="Arch+Xmonad = Crazy Delicious" width="100" height="100" /></a><p class="wp-caption-text">Arch+Xmonad = Crazy Delicious</p></div></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.webframp.com/2008/11/28/the-non-intrusive-user-interface/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Two months and still nothing to write home about.</title>
		<link>http://www.webframp.com/2008/11/14/two-months-and-still-nothing-to-write-home-about/</link>
		<comments>http://www.webframp.com/2008/11/14/two-months-and-still-nothing-to-write-home-about/#comments</comments>
		<pubDate>Sat, 15 Nov 2008 00:50:59 +0000</pubDate>
		<dc:creator>sean</dc:creator>
				<category><![CDATA[*nix]]></category>
		<category><![CDATA[dzen]]></category>
		<category><![CDATA[haskell]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[xmonad]]></category>

		<guid isPermaLink="false">http://www.webframp.com/?p=53</guid>
		<description><![CDATA[Been a while since the last update. I guess as the saying goes, &#8220;if you don&#8217;t have something good to say&#8230;&#8221; I have been learning haskell, using xmonad, and loving 64bit Arch Linux., so a few notes on each are in order.
Haskell
Haskell has been described as the algebra of programming, and is an advanced purely [...]]]></description>
			<content:encoded><![CDATA[<p>Been a while since the last update. I guess as the saying goes, &#8220;if you don&#8217;t have something good to say&#8230;&#8221; I have been learning <a title="haskell" href="http://haskell.org/haskellwiki/Haskell">haskell</a>, using <a title="xmonad window manager" href="http://xmonad.org">xmonad</a>, and loving 64bit Arch Linux., so a few notes on each are in order.</p>
<h3>Haskell</h3>
<p>Haskell has been described as the algebra of programming, and is an advanced<a title="Functional Programming" href="http://haskell.org/haskellwiki/Functional_programming"> purely functional programming language</a>. If your a math/language geek like myself, it&#8217;s rights up your alley. It&#8217;s been a delight to delve deeper into a language I previously had only a passing familiarity with.</p>
<h3>Xmonad</h3>
<p><a title="xmonad window manager" href="http://xmonad.org/">Xmonad</a> is a lightweight tiling window manager writen entirely in haskell and it&#8217;s rock solid stable because of it. The configuration file itself is a dynamically compiled haskell module, which means your free to do whatever you can within the limits of your knowledge. That&#8217;s how it should be. There&#8217;s a very fully featured set of community contributed extensions, <a title="xmonad-contrib" href="http://xmonad.org/xmonad-docs/xmonad-contrib/">xmonad-contrib</a>, that provides many more extendable features and the community is helpful and intelligent. Both valuable traits.</p>
<h3>Arch Linux</h3>
<p>And finally <a title="Arch Linux" href="http://www.archlinux.org">Arch</a>. After a week or two of struggling with Ubuntu/apt and some outdated packages I was so fed up I switch. Rsync&#8217;d my entire home directory to my backup server one final time, and did a fresh install of 64 bit Arch. Now least of all its&#8217;s nice to have access to all 4GB of RAM in my laptop. Boot times are quicker too.</p>
<p>In all things are snappier, and that make me a happy person.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.webframp.com/2008/11/14/two-months-and-still-nothing-to-write-home-about/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Google Scrubs the cache for Chrome</title>
		<link>http://www.webframp.com/2008/09/02/google-scrubs-the-cache-for-chrome/</link>
		<comments>http://www.webframp.com/2008/09/02/google-scrubs-the-cache-for-chrome/#comments</comments>
		<pubDate>Tue, 02 Sep 2008 18:46:24 +0000</pubDate>
		<dc:creator>sean</dc:creator>
				<category><![CDATA[musings]]></category>
		<category><![CDATA[Browser]]></category>
		<category><![CDATA[Chrome]]></category>
		<category><![CDATA[Google]]></category>

		<guid isPermaLink="false">http://www.webframp.com/?p=47</guid>
		<description><![CDATA[According to this article at Computerworld google has scrubbed results for the download link for their new Chrome browser. If you get results like these:

It&#8217;s likely it won&#8217;t work.
No doubt this won&#8217;t be an issue once the Chrome Announcement is over.
Live video of Chrome Annoucement is available here
]]></description>
			<content:encoded><![CDATA[<p>According to <a href="http://www.computerworld.com/action/article.do?command=viewArticleBasic&#038;articleId=9114001&#038;intsrc=news_ts_head">this article at Computerworld</a> google has scrubbed results for the download link for their new Chrome browser. If you get results like these:</p>
<p><a href="http://www.webframp.com/wp-content/uploads/2008/09/googlescrubs.jpg"><img src="http://www.webframp.com/wp-content/uploads/2008/09/googlescrubs-299x54.jpg" alt="" title="Google Scrubs resutls" width="299" height="54" class="alignnone size-medium wp-image-48" /></a></p>
<p>It&#8217;s likely it won&#8217;t work.</p>
<p>No doubt this won&#8217;t be an issue once the Chrome Announcement is over.</p>
<p>Live video of <a href="http://news.cnet.com/8301-17939_109-10030035-2.html?tag=txt">Chrome Annoucement is available here</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.webframp.com/2008/09/02/google-scrubs-the-cache-for-chrome/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Switch+dzen</title>
		<link>http://www.webframp.com/2008/08/17/switchdzen/</link>
		<comments>http://www.webframp.com/2008/08/17/switchdzen/#comments</comments>
		<pubDate>Sun, 17 Aug 2008 08:23:15 +0000</pubDate>
		<dc:creator>sean</dc:creator>
				<category><![CDATA[musings]]></category>
		<category><![CDATA[arch]]></category>
		<category><![CDATA[dzen]]></category>
		<category><![CDATA[linux]]></category>

		<guid isPermaLink="false">http://www.webframp.com/?p=41</guid>
		<description><![CDATA[Well Ubunut Intrepid may turn out to be great, but the recent ubuntu upgrade on my part proved to me how tired I was of dealing with apt and it&#8217;s pkg management system. How many debian users actually know what it&#8217;s really doing?
So I switched. To Arch.

Lately it seems like every useful tip I&#8217;ve gleaned [...]]]></description>
			<content:encoded><![CDATA[<p>Well Ubunut Intrepid may turn out to be great, but the recent ubuntu upgrade on my part proved to me how tired I was of dealing with apt and it&#8217;s pkg management system. How many debian users actually know what it&#8217;s really doing?</p>
<p>So I switched. To Arch.</p>
<p>
Lately it seems like every useful tip I&#8217;ve gleaned has been from either the gentoo or arch wiki, so I had narrowed it down to one of the two. Both are appealing for their BSD style init systems and simple script based pacakge systems. Gentoo is full source though which, while not really a negative for most modern systems, was something I didn&#8217;t want to be restricted to. Arch allows a flexible binary or source build system, although the actual repo&#8217;s are binary. I love the rolling kernel too, no more waiting 6 months to get the latest, risking a broken system by upgrading in between.
</p>
<p>
In the process of switching I have fine-tuned things to the extreme. One of the tweaks is the battery status bar I use. It&#8217;s just a simple shell script that outputs formatted text to dzen2. It always bugged me that the script didn&#8217;t notice the charging state. After a simple little change, it does.
</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">#!/bin/sh</span>
<span style="color: #666666; font-style: italic;">#</span>
<span style="color: #666666; font-style: italic;"># original script by lyon8 &amp;lt;lyon8@gmx.net&amp;gt;</span>
<span style="color: #666666; font-style: italic;"># modifications from original by &amp;lt;sean.escriva@gmail.com&amp;gt;</span>
<span style="color: #666666; font-style: italic;"># show your laptop battery state in dzen</span>
&nbsp;
<span style="color: #007800;">BG</span>=<span style="color: #ff0000;">'#1c2636'</span>  <span style="color: #666666; font-style: italic;"># dzen backgrounad</span>
<span style="color: #007800;">FG</span>=<span style="color: #ff0000;">'#99ffff'</span>  <span style="color: #666666; font-style: italic;"># dzen foreground</span>
<span style="color: #007800;">W</span>=<span style="color: #000000;">150</span>         <span style="color: #666666; font-style: italic;"># width of the dzen bar</span>
<span style="color: #007800;">GW</span>=<span style="color: #000000;">50</span>         <span style="color: #666666; font-style: italic;"># width of the gauge</span>
<span style="color: #007800;">GFG</span>=<span style="color: #ff0000;">'#33ccff'</span>  <span style="color: #666666; font-style: italic;"># color of the gauge</span>
<span style="color: #007800;">GH</span>=<span style="color: #000000;">7</span>          <span style="color: #666666; font-style: italic;"># height of the gauge</span>
<span style="color: #007800;">GBG</span>=<span style="color: #ff0000;">'#333'</span>    <span style="color: #666666; font-style: italic;"># color of gauge background</span>
<span style="color: #007800;">X</span>=<span style="color: #000000;">1770</span>        <span style="color: #666666; font-style: italic;"># x position</span>
<span style="color: #007800;">Y</span>=<span style="color: #000000;">1200</span>        <span style="color: #666666; font-style: italic;"># y position</span>
<span style="color: #007800;">FN</span>=<span style="color: #ff0000;">'snap'</span>     <span style="color: #666666; font-style: italic;"># font</span>
&nbsp;
<span style="color: #007800;">STATEFILE</span>=<span style="color: #ff0000;">'/proc/acpi/battery/BAT0/state'</span> <span style="color: #666666; font-style: italic;"># battery's state file</span>
<span style="color: #007800;">INFOFILE</span>=<span style="color: #ff0000;">'/proc/acpi/battery/BAT0/info'</span>   <span style="color: #666666; font-style: italic;"># battery's info file</span>
&nbsp;
<span style="color: #007800;">LOWBAT</span>=<span style="color: #000000;">25</span>        <span style="color: #666666; font-style: italic;"># percentage of battery life marked as low</span>
<span style="color: #007800;">LOWCOL</span>=<span style="color: #ff0000;">'#ff4747'</span> <span style="color: #666666; font-style: italic;"># color when battery is low</span>
<span style="color: #007800;">CHGCOL</span>=<span style="color: #ff0000;">'#60da11'</span> <span style="color: #666666; font-style: italic;"># color when battery is charging</span>
<span style="color: #007800;">TIME_INT</span>=<span style="color: #000000;">1</span>       <span style="color: #666666; font-style: italic;"># time intervall in seconds</span>
&nbsp;
<span style="color: #007800;">PREBAR</span>=<span style="color: #ff0000;">'^i(/home/webframp/.dzen/icons/dzen_bitmaps/battery.xbm) '</span> <span style="color: #666666; font-style: italic;"># caption (also icons are possible)</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">while</span> <span style="color: #c20cb9; font-weight: bold;">true</span>; <span style="color: #000000; font-weight: bold;">do</span>
<span style="color: #666666; font-style: italic;"># look up battery's data</span>
<span style="color: #007800;">BAT_FULL</span>=<span style="color: #000000; font-weight: bold;">`</span><span style="color: #c20cb9; font-weight: bold;">cat</span> <span style="color: #007800;">$INFOFILE</span><span style="color: #000000; font-weight: bold;">|</span><span style="color: #c20cb9; font-weight: bold;">grep</span> design<span style="color: #000000; font-weight: bold;">|</span>line<span style="color: #000000; font-weight: bold;">|</span><span style="color: #c20cb9; font-weight: bold;">cut</span> <span style="color: #660033;">-d</span> <span style="color: #ff0000;">&quot; &quot;</span> <span style="color: #660033;">-f</span> <span style="color: #000000;">11</span><span style="color: #000000; font-weight: bold;">`</span>;
<span style="color: #007800;">STATUS</span>=<span style="color: #000000; font-weight: bold;">`</span><span style="color: #c20cb9; font-weight: bold;">cat</span> <span style="color: #007800;">$STATEFILE</span><span style="color: #000000; font-weight: bold;">|</span><span style="color: #c20cb9; font-weight: bold;">grep</span> charging<span style="color: #000000; font-weight: bold;">|</span><span style="color: #c20cb9; font-weight: bold;">cut</span> <span style="color: #660033;">-d</span> <span style="color: #ff0000;">&quot; &quot;</span> <span style="color: #660033;">-f</span> <span style="color: #000000;">12</span><span style="color: #000000; font-weight: bold;">`</span>;
<span style="color: #007800;">RCAP</span>=<span style="color: #000000; font-weight: bold;">`</span><span style="color: #c20cb9; font-weight: bold;">cat</span> <span style="color: #007800;">$STATEFILE</span><span style="color: #000000; font-weight: bold;">|</span><span style="color: #c20cb9; font-weight: bold;">grep</span> remaining<span style="color: #000000; font-weight: bold;">|</span><span style="color: #c20cb9; font-weight: bold;">cut</span> <span style="color: #660033;">-d</span> <span style="color: #ff0000;">&quot; &quot;</span> <span style="color: #660033;">-f</span> <span style="color: #000000;">8</span><span style="color: #000000; font-weight: bold;">`</span>;
&nbsp;
<span style="color: #666666; font-style: italic;"># calculate remaining power</span>
<span style="color: #007800;">RPERCT</span>=<span style="color: #000000; font-weight: bold;">`</span><span style="color: #c20cb9; font-weight: bold;">expr</span> <span style="color: #007800;">$RCAP</span> \<span style="color: #000000; font-weight: bold;">*</span> <span style="color: #000000;">100</span><span style="color: #000000; font-weight: bold;">`</span>;
<span style="color: #007800;">RPERC</span>=<span style="color: #000000; font-weight: bold;">`</span><span style="color: #c20cb9; font-weight: bold;">expr</span> <span style="color: #007800;">$RPERCT</span> <span style="color: #000000; font-weight: bold;">/</span> <span style="color: #007800;">$BAT_FULL</span><span style="color: #000000; font-weight: bold;">`</span>;
&nbsp;
<span style="color: #666666; font-style: italic;"># draw the bar and pipe everything into dzen</span>
<span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #007800;">$RPERC</span> <span style="color: #660033;">-le</span> <span style="color: #007800;">$LOWBAT</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span>; <span style="color: #000000; font-weight: bold;">then</span>
<span style="color: #007800;">GFG</span>=<span style="color: #007800;">$LOWCOL</span>;
<span style="color: #000000; font-weight: bold;">fi</span>
<span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #007800;">$STATUS</span> = <span style="color: #ff0000;">'charging'</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span>; <span style="color: #000000; font-weight: bold;">then</span>
<span style="color: #007800;">GFG</span>=<span style="color: #007800;">$CHGCOL</span>;
<span style="color: #000000; font-weight: bold;">else</span>
<span style="color: #007800;">GFG</span>=<span style="color: #ff0000;">'#33ccff'</span>;
<span style="color: #000000; font-weight: bold;">fi</span>
<span style="color: #666666; font-style: italic;">#echo -n $PREBAR #uncomment for an icon</span>
<span style="color: #7a0874; font-weight: bold;">eval</span> <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #007800;">$RPERC</span> <span style="color: #000000; font-weight: bold;">|</span> gdbar <span style="color: #660033;">-h</span> <span style="color: #007800;">$GH</span> <span style="color: #660033;">-w</span> <span style="color: #007800;">$GW</span> <span style="color: #660033;">-fg</span> <span style="color: #007800;">$GFG</span> <span style="color: #660033;">-bg</span> <span style="color: #007800;">$GBG</span>
<span style="color: #c20cb9; font-weight: bold;">sleep</span> <span style="color: #007800;">$TIME_INT</span>;
<span style="color: #000000; font-weight: bold;">done</span> <span style="color: #000000; font-weight: bold;">|</span> dzen2 <span style="color: #660033;">-ta</span> c <span style="color: #660033;">-tw</span> <span style="color: #007800;">$W</span> <span style="color: #660033;">-y</span> <span style="color: #007800;">$Y</span> <span style="color: #660033;">-x</span> <span style="color: #007800;">$X</span> <span style="color: #660033;">-fg</span> <span style="color: #007800;">$FG</span> <span style="color: #660033;">-bg</span> <span style="color: #007800;">$BG</span> <span style="color: #660033;">-fn</span> <span style="color: #007800;">$FN</span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://www.webframp.com/2008/08/17/switchdzen/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Intrepid Development release upgrade</title>
		<link>http://www.webframp.com/2008/08/10/intrepid-development-release-upgrade/</link>
		<comments>http://www.webframp.com/2008/08/10/intrepid-development-release-upgrade/#comments</comments>
		<pubDate>Sun, 10 Aug 2008 17:05:48 +0000</pubDate>
		<dc:creator>sean</dc:creator>
				<category><![CDATA[*nix]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false">http://www.webframp.com/2008/08/10/intrepid-development-release-upgrade/</guid>
		<description><![CDATA[Went through the officially recommended upgrade process for Ubuntu last night. Overall extremely painless and reminded me why its worth using a distro with package management. A few notes though:
One of the first things I like to do is blacklist pcspkr, I hate that beep and it is almost always useless for me. It seems [...]]]></description>
			<content:encoded><![CDATA[<p>Went through the officially recommended upgrade process for Ubuntu last night. Overall extremely painless and reminded me why its worth using a distro with package management. A few notes though:</p>
<p>One of the first things I like to do is blacklist pcspkr, I hate that beep and it is almost always useless for me. It seems the kernel module name has changed from pcspkr to snd_pcsp, had to change the line accordingly /etc/modprobe.d/blacklist</p>
<p>Wireless also doesn&#8217;t work, but the drivers have changed from what I understand, so that&#8217;s to be expected.</p>
<p>It should be fun to explore the rest if the Intrepid Ibex and see what&#8217;s new.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.webframp.com/2008/08/10/intrepid-development-release-upgrade/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
