sites

public wiki contents of suckless.org
git clone git://git.suckless.org/sites
Log | Files | Refs

commit 3054eab874b59c49a5dbe61678051da06665fab1
parent 420f797006c392ae178006a99a9965f2758588dd
Author: Alexis Ben Miloud--Josselin <alexis.bmj@protonmail.com>
Date:   Sun,  4 Jun 2017 14:53:10 +0200

Add an alert patch for sic

This patch print the bell character '\a' to stdout when the nick is found in the channel or in the message.

Diffstat:
Atools.suckless.org/sic/patches/alert.md | 14++++++++++++++
Atools.suckless.org/sic/patches/sic-alert-20160604-9bb34de.diff | 13+++++++++++++
2 files changed, 27 insertions(+), 0 deletions(-)

diff --git a/tools.suckless.org/sic/patches/alert.md b/tools.suckless.org/sic/patches/alert.md @@ -0,0 +1,14 @@ +Alert +===== + +Description +----------- +This patch make sic produce an alert by printing a bell character to stdout when the nick is found in an incoming message. + +Download +-------- +* [sic-alert-20160604-9bb34de.diff](sic-alert-20160604-9bb34de.diff) (385) (20170604) + +Author +------ +* Alexis Ben Miloud--Josselin (panpo) <[alexis.bmj@protonmail.com](alexis.bmj@protonmail.com)> diff --git a/tools.suckless.org/sic/patches/sic-alert-20160604-9bb34de.diff b/tools.suckless.org/sic/patches/sic-alert-20160604-9bb34de.diff @@ -0,0 +1,13 @@ +diff --git a/sic.c b/sic.c +index ecefaf2..f99f1a7 100644 +--- a/sic.c ++++ b/sic.c +@@ -38,6 +38,8 @@ pout(char *channel, char *fmt, ...) { + t = time(NULL); + strftime(timestr, sizeof timestr, TIMESTAMP_FORMAT, localtime(&t)); + fprintf(stdout, "%-12s: %s %s\n", channel, timestr, bufout); ++ if (strstr(channel, nick) || strstr(bufout, nick)) ++ fprintf(stdout, "\a"); + } + + static void