From: Vincent Le Gallic Date: Wed, 4 Jan 2017 10:48:19 +0000 (+0100) Subject: [notifyirc] PoC d'un script qui m'envoie une alerte gnome sur un hl X-Git-Url: http://gitweb.pimeys.fr/?p=scripts-20-100.git;a=commitdiff_plain;h=4f43ba394fe3543ec4615f2f4d2614d6bf6700c3 [notifyirc] PoC d'un script qui m'envoie une alerte gnome sur un hl Pour l'instant hardcodé pour LaLoutre. À améliorer. --- diff --git a/notifyirc.sh b/notifyirc.sh new file mode 100755 index 0000000..1f4a4ab --- /dev/null +++ b/notifyirc.sh @@ -0,0 +1,15 @@ +#!/bin/bash +ssh zamok tail -n 0 -f .weechat/logs/crans/*/*/laloutre.log \ +| while read line; do + echo "${line}" | grep "notify" + if [ $? = 0 ] + then + # On enlève le timestamp + line=$(echo "${line}" | sed 's/^....-..-.. ..:..:..\t//') + # On isole le pseudo. + pseudo=$(echo "${line}" | sed 's/^\([^\t]\+\)\t.*/\1/') + line=$(echo "${line}" | sed 's/^[^\t]\+\t//') + # On notifie avec en titre le pseudo et en contenu le reste de la ligne + notify-send -i /home/vincent/otter.gif "${pseudo}" "${line}" + fi +done