mcabber

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