Last active
October 30, 2020 21:45
-
-
Save mcpcpc/d40eb3ce2c01e49144ef7f75f7776c10 to your computer and use it in GitHub Desktop.
kirc notifications
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# | |
# checks log file for substring, usually your own nick, and sends message to specified program. | |
# message notification includes the senders nick. | |
main () { | |
while true; do | |
tail -fn5 "$1" | awk '/PRIVMSG #.*nick.*/ { | |
sub(/:/,""); sub(/!/," "); print "\x27" $1 " - new message" "\x27" | |
exit | |
}' | xargs herbe | |
sleep 5 | |
done | |
} | |
main "$1" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Usage