mcabber

annotate mcabber/contrib/events/eventcmd.osd @ 1560:ec55cdf44335

Fix a memory leak in hlog_get_log_jid()
author Mikael Berthe <mikael@lilotux.net>
date Fri, 17 Oct 2008 18:55:58 +0200
parents
children
rev   line source
mikael@1147 1 #! /bin/sh
mikael@1147 2 #
mikael@1147 3 # Sample events script for mcabber
mikael@1147 4 # Use OSD to display events on the user's desktop
mikael@1147 5 #
mikael@1147 6 # To use this script, set the "events_command" option to the path of
mikael@1147 7 # the script (see the mcabberrc.example file for an example)
mikael@1147 8 #
mikael@1147 9 # MiKael, 2006-01-07
mikael@1147 10
mikael@1147 11 XOSD_CMD_PIPE='osd_cat --pos=bottom --align=center --delay=4 --color=magenta --font=-*-courier-*-*-*-*-14-*-*-*-*-*-iso8859-15'
mikael@1147 12
mikael@1147 13 event=$1
mikael@1147 14 arg1=$2
mikael@1147 15 arg2=$3
mikael@1147 16 filename=$4
mikael@1147 17 # Note that the 4th argument is only provided for incoming messages
mikael@1147 18 # and when 'event_log_files' is set.
mikael@1147 19
mikael@1147 20 if [ $event = "MSG" ]; then
mikael@1147 21 case "$arg1" in
mikael@1147 22 IN)
mikael@1147 23 # Incoming message from buddy $arg2
mikael@1147 24 echo "You have an IM from <$arg2>" | $XOSD_CMD_PIPE > /dev/null 2>&1
mikael@1147 25 if [ -n "$filename" -a -f "$filename" ]; then
mikael@1147 26 # We could process filename here...
mikael@1147 27 /bin/rm $filename
mikael@1147 28 fi
mikael@1147 29 ;;
mikael@1147 30 MUC)
mikael@1147 31 # Groupchat message in room $arg2
mikael@1147 32 if [ -n "$filename" && -f "$filename" ]; then
mikael@1147 33 # We could process filename here...
mikael@1147 34 /bin/rm $filename
mikael@1147 35 fi
mikael@1147 36 ;;
mikael@1147 37 OUT)
mikael@1147 38 # Outgoing message for buddy $arg2
mikael@1147 39 ;;
mikael@1147 40 esac
mikael@1147 41 elif [ $event = "STATUS" ]; then
mikael@1147 42 # Buddy $arg2 status is $arg1 (_, O, I, F, D, N, A)
mikael@1147 43 echo "<$arg2> has changed status to: [$arg1]" | $XOSD_CMD_PIPE > /dev/null 2>&1
mikael@1147 44 echo > /dev/null
mikael@1147 45 fi
mikael@1147 46