mcabber
diff 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 |
line diff
1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/mcabber/contrib/events/eventcmd.osd Fri Oct 17 18:55:58 2008 +0200 1.3 @@ -0,0 +1,46 @@ 1.4 +#! /bin/sh 1.5 +# 1.6 +# Sample events script for mcabber 1.7 +# Use OSD to display events on the user's desktop 1.8 +# 1.9 +# To use this script, set the "events_command" option to the path of 1.10 +# the script (see the mcabberrc.example file for an example) 1.11 +# 1.12 +# MiKael, 2006-01-07 1.13 + 1.14 +XOSD_CMD_PIPE='osd_cat --pos=bottom --align=center --delay=4 --color=magenta --font=-*-courier-*-*-*-*-14-*-*-*-*-*-iso8859-15' 1.15 + 1.16 +event=$1 1.17 +arg1=$2 1.18 +arg2=$3 1.19 +filename=$4 1.20 +# Note that the 4th argument is only provided for incoming messages 1.21 +# and when 'event_log_files' is set. 1.22 + 1.23 +if [ $event = "MSG" ]; then 1.24 + case "$arg1" in 1.25 + IN) 1.26 + # Incoming message from buddy $arg2 1.27 + echo "You have an IM from <$arg2>" | $XOSD_CMD_PIPE > /dev/null 2>&1 1.28 + if [ -n "$filename" -a -f "$filename" ]; then 1.29 + # We could process filename here... 1.30 + /bin/rm $filename 1.31 + fi 1.32 + ;; 1.33 + MUC) 1.34 + # Groupchat message in room $arg2 1.35 + if [ -n "$filename" && -f "$filename" ]; then 1.36 + # We could process filename here... 1.37 + /bin/rm $filename 1.38 + fi 1.39 + ;; 1.40 + OUT) 1.41 + # Outgoing message for buddy $arg2 1.42 + ;; 1.43 + esac 1.44 +elif [ $event = "STATUS" ]; then 1.45 + # Buddy $arg2 status is $arg1 (_, O, I, F, D, N, A) 1.46 + echo "<$arg2> has changed status to: [$arg1]" | $XOSD_CMD_PIPE > /dev/null 2>&1 1.47 + echo > /dev/null 1.48 +fi 1.49 +
