jeroen.se
by jnieuwen
irc hilights displayed in the zsh shell
zsh has another nice feature I use to display the latest hilights on irc. The zsh option I use for this is the periodic function and the PERIOD environment variable. First off all I have set PERIOD to 60 in my ~/.zshrc config file. This ensures that the periodic function is executed before a new prompt if at least 60 seconds have passed.
The periodic function is defined as:
function periodic() {
diff $HOME/.periodic/last_hilight $HOME/.periodic/last_hilight.old | grep "^<" | cut -f2- -d: | sed -e "s/:/ /" -e "s/^/IRC: /" && cp $HOME/.periodic/last_hilight $HOM E/.periodic/last_hilight.old
}
Which means that it compares the $HOME/.periodic/last_hilight file with the $HOME/.periodic/last_hiligt.old file and displays the difference.
You might wonder how the last hilight from irc now comes in the $HOME/.periodic/last_hilight file. This is accomplished by an irssi plugin I extended. More on this plugin later because I still have to document this extension.
0 comments

Nick:
Email:
Make your own addition with integers (needed to make sure you aint a spambot):
+ =
Categories
Cycling (2)
Gadgets (3)
Misc (22)
Scripting (23)
Travel (7)
Unix (24)
Archive
April 2010 (2)
January 2010 (1)
December 2009 (1)
November 2009 (2)
May 2009 (1)
April 2009 (1)
March 2009 (1)
February 2009 (7)
January 2009 (3)
December 2008 (1)
November 2008 (4)
October 2008 (5)
September 2008 (1)
August 2008 (3)
July 2008 (2)
June 2008 (2)
May 2008 (3)
April 2008 (1)
March 2008 (1)
February 2008 (1)
January 2008 (4)
December 2007 (1)
November 2007 (7)
October 2007 (4)
September 2007 (1)
August 2007 (2)
June 2007 (6)
May 2007 (8)