#!/bin/sed -uf # ics.sed colorize ics output # Copyright 2007 Ali Polatel # Distributed under the terms of the GNU General Public License v2 # You need to disable xboard's coloring # and iset nowrap 1 for this to work. # # Note: You can't set nowrap to 1 when after you connect to ics using # xboard because it issues iset lock 1 after which the interface # variables can't be changed. So either write a wrapper script to call # xboard and "echo iset nowrap 1" or you can try the following patch: # http://hawking.nonlogic.org/stuff/ics/xboard-4.2.7-nowrap.patch # # This script uses standard color codes for shells: # Have a look at http://wookimus.net/~chewie/src/color.sed # You need a terminal with 256 color support for colors to display properly # TODO # parse: # bughouse partner tells # tourney tells # First get rid of the prompt /^fics% $/d s/^fics% // /^(told .*)/b notification /^-->.*/b shout /^[^ ]* shouts: .*/b shout /^[^ ]* \(t|c\)-shouts: .*/b cshout /^[^ ]* tells you: .*/b ptell /^[^ ]* says: .*/b ptell /^:.*/b qtell /^[^ ]* kibitzes: .*/b kibitz /^[^ ]* whispers: .*/b kibitz /^[^ ]*(1): .*/b ch_help /^[^ ]*(2): .*/b ch_help /^[^ ]*(36): .*/b ch_physics /^[^ ]*(49): .*/b ch_mamer /^[^ ]*(85): .*/b ch_unix /^[^ ]*(88): .*/b ch_programming /^[^ ]*([0-9]*): .*/b ch_default b default :ch_default # default channel color is blue s/.*/&/ b :ch_help # help channel tells are cyan s/.*/&/ b :ch_mamer # mamer channel is bold red s/.*/&/ b :ch_physics # math_physics channel is bold green s/.*/&/ b :ch_programming # programming channel tells are bold magenta s/.*/&/ b :ch_unix # unix channel tells are bold cyan s/.*/&/ b :kibitz s/.*/&/ b :notification # notifications are dark gray s/.*/&/ b :ptell # private tells are yellow s/.*/&/ b :qtell s/.*/&/ b :cshout s/.*/&/ b :shout # shouts are cyan s/.*/&/ b :default s/.*/&/