comparison mcabber/contrib/events/eventcmd.osd @ 1147:fcef5d34b7d4

Add a few sample event scripts
author Mikael Berthe <mikael@lilotux.net>
date Sat, 10 Feb 2007 18:42:02 +0100
parents
children 4889f429fdd0
comparison
equal deleted inserted replaced
1146:d9eb7656440f 1147:fcef5d34b7d4
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
10
11 XOSD_CMD_PIPE='osd_cat --pos=bottom --align=center --delay=4 --color=magenta --font=-*-courier-*-*-*-*-14-*-*-*-*-*-iso8859-15'
12
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.
19
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
46