# ...Cleaned up just a little bit: 

BEGIN{
  color["default"]="7" # white
  color["work"]="1" # red
  color["home"]="2" # green
  color["play"]="3" # yellow
  color["family"]="4" # blue
  color["friends"]="5" # magenta
  color["market"]="6" # cyan
  categ_re="category: [^ ][^ ]* *"
}
{
  printf $1
  msg=substr($0, index($0, " "))
  match(msg, categ_re)
  split(substr(msg, RSTART, RLENGTH), categ, " ")
  printf("\033[3%sm", \
    categ[2] > 0 ? color[categ[2]] : color["default"])
  sub(categ_re, "", msg)
  printf("%s\033[3%sm\n", msg, color["default"])
}

_______________________________________________
Remind-fans mailing list
[email protected]
http://lists.roaringpenguin.com/cgi-bin/mailman/listinfo/remind-fans
Remind is at http://www.roaringpenguin.com/products/remind

Reply via email to