Commits

Anonymous committed 3348f49

add cw_color.sh not installed by default, add fflush() where needed for sic to work

  • Participants
  • Parent commits d7b8352

Comments (0)

Files changed (3)

  */
 
 #define CMD { "urxvt", "-title", paths[wd], "-e", "srw", "-p", channel, "cw", out, in, NULL }
+
+/*
+ * Use this if you want colors and bell on your nick. You must first edit cw_color.sh to change the
+ * nick, and then place it in your path. It is not installed by default.
+ */
+//#define CMD { "urxvt", "-title", paths[wd], "-e", "srw", "-p", channel, "cw_color.sh", out, in, NULL }
 
 	while (fgets(buf, sizeof(buf), in))
 		fputs(buf, stdout);
+	fflush(stdout);
 
 	if ((out = fopen(argv[2], "w")) == NULL)
 		err(1, "failed to fopen %s", argv[2]);
 
 			while (fgets(buf, sizeof(buf), in))
 				fputs(buf, stdout);
+			fflush(stdout);
 		}
 		if (FD_ISSET(fileno(stdin), &rd)) {
 			fgets(buf, sizeof(buf), stdin);
+#!/bin/sh
+NICK="$USER"
+
+cw "$@" | sed -e "s/^\([-0-9]\{10,10\}\) \([:0-9]\{5,5\}\) <\(.*\)>/${yellow}\1 ${green}\2${reset} <${cyan}\3${reset}>/" \
+              -e "s/^\([-0-9]\{10,10\}\) \([:0-9]\{5,5\}\) \(-!-\)/${yellow}\1 ${green}\2${reset} ${magenta}\3${reset}/" \
+              -e "s/^\([-0-9]\{10,10\}\) \([:0-9]\{5,5\}\)/${yellow}\1 ${green}\2${reset}/" \
+              -e "s/$NICK/\a${red}&${reset}/g"