Mercurial > hg
annotate mcabber/contrib/eventcmd @ 396:7f5135836b56 0.6.6
Ready for 0.6.6 release
author | Mikael Berthe <mikael@lilotux.net> |
---|---|
date | Wed, 17 Aug 2005 18:15:00 +0100 |
parents | c5a7a7273986 |
children | 2fd528c49173 |
rev | line source |
---|---|
316
e315566f09b0
Add a sample script for the events command
Mikael Berthe <mikael@lilotux.net>
parents:
diff
changeset
|
1 #! /bin/sh |
e315566f09b0
Add a sample script for the events command
Mikael Berthe <mikael@lilotux.net>
parents:
diff
changeset
|
2 # |
e315566f09b0
Add a sample script for the events command
Mikael Berthe <mikael@lilotux.net>
parents:
diff
changeset
|
3 # Sample events script for mcabber |
e315566f09b0
Add a sample script for the events command
Mikael Berthe <mikael@lilotux.net>
parents:
diff
changeset
|
4 # Plays a sound when receiving a message |
e315566f09b0
Add a sample script for the events command
Mikael Berthe <mikael@lilotux.net>
parents:
diff
changeset
|
5 # |
e315566f09b0
Add a sample script for the events command
Mikael Berthe <mikael@lilotux.net>
parents:
diff
changeset
|
6 # To use this script, set the "events_command" option to the path of |
e315566f09b0
Add a sample script for the events command
Mikael Berthe <mikael@lilotux.net>
parents:
diff
changeset
|
7 # the script (see the mcabberrc.example file for an example) |
e315566f09b0
Add a sample script for the events command
Mikael Berthe <mikael@lilotux.net>
parents:
diff
changeset
|
8 # |
e315566f09b0
Add a sample script for the events command
Mikael Berthe <mikael@lilotux.net>
parents:
diff
changeset
|
9 # MiKael, 2005-07-15 |
e315566f09b0
Add a sample script for the events command
Mikael Berthe <mikael@lilotux.net>
parents:
diff
changeset
|
10 |
e315566f09b0
Add a sample script for the events command
Mikael Berthe <mikael@lilotux.net>
parents:
diff
changeset
|
11 # The following sound comes with the gtkboard package, |
e315566f09b0
Add a sample script for the events command
Mikael Berthe <mikael@lilotux.net>
parents:
diff
changeset
|
12 # you can modify this line to play another one... |
e315566f09b0
Add a sample script for the events command
Mikael Berthe <mikael@lilotux.net>
parents:
diff
changeset
|
13 CMD_MSG_IN="/usr/bin/play /usr/share/sounds/gtkboard/machine_move.ogg" |
e315566f09b0
Add a sample script for the events command
Mikael Berthe <mikael@lilotux.net>
parents:
diff
changeset
|
14 |
e315566f09b0
Add a sample script for the events command
Mikael Berthe <mikael@lilotux.net>
parents:
diff
changeset
|
15 event=$1 |
e315566f09b0
Add a sample script for the events command
Mikael Berthe <mikael@lilotux.net>
parents:
diff
changeset
|
16 arg1=$2 |
e315566f09b0
Add a sample script for the events command
Mikael Berthe <mikael@lilotux.net>
parents:
diff
changeset
|
17 arg2=$3 |
e315566f09b0
Add a sample script for the events command
Mikael Berthe <mikael@lilotux.net>
parents:
diff
changeset
|
18 |
e315566f09b0
Add a sample script for the events command
Mikael Berthe <mikael@lilotux.net>
parents:
diff
changeset
|
19 if [ $event == "MSG" ]; then |
e315566f09b0
Add a sample script for the events command
Mikael Berthe <mikael@lilotux.net>
parents:
diff
changeset
|
20 case "$arg1" in |
e315566f09b0
Add a sample script for the events command
Mikael Berthe <mikael@lilotux.net>
parents:
diff
changeset
|
21 IN) |
e315566f09b0
Add a sample script for the events command
Mikael Berthe <mikael@lilotux.net>
parents:
diff
changeset
|
22 # Incoming message from buddy $arg2 |
e315566f09b0
Add a sample script for the events command
Mikael Berthe <mikael@lilotux.net>
parents:
diff
changeset
|
23 $CMD_MSG_IN > /dev/null 2>&1 |
e315566f09b0
Add a sample script for the events command
Mikael Berthe <mikael@lilotux.net>
parents:
diff
changeset
|
24 ;; |
e315566f09b0
Add a sample script for the events command
Mikael Berthe <mikael@lilotux.net>
parents:
diff
changeset
|
25 OUT) |
e315566f09b0
Add a sample script for the events command
Mikael Berthe <mikael@lilotux.net>
parents:
diff
changeset
|
26 # Outgoing message for buddy $arg2 |
e315566f09b0
Add a sample script for the events command
Mikael Berthe <mikael@lilotux.net>
parents:
diff
changeset
|
27 ;; |
e315566f09b0
Add a sample script for the events command
Mikael Berthe <mikael@lilotux.net>
parents:
diff
changeset
|
28 esac |
355
c5a7a7273986
Add some external actions
Mikael Berthe <mikael@lilotux.net>
parents:
316
diff
changeset
|
29 elif [ $event == "STATUS" ]; then |
c5a7a7273986
Add some external actions
Mikael Berthe <mikael@lilotux.net>
parents:
316
diff
changeset
|
30 # Buddy $arg2 status is $arg1 (_, O, I, F, D, N, A) |
c5a7a7273986
Add some external actions
Mikael Berthe <mikael@lilotux.net>
parents:
316
diff
changeset
|
31 echo > /dev/null |
316
e315566f09b0
Add a sample script for the events command
Mikael Berthe <mikael@lilotux.net>
parents:
diff
changeset
|
32 fi |
e315566f09b0
Add a sample script for the events command
Mikael Berthe <mikael@lilotux.net>
parents:
diff
changeset
|
33 |