author | Mikael Berthe <mikael@lilotux.net> |
Tue, 27 Sep 2005 21:58:01 +0200 | |
changeset 457 | 2fd528c49173 |
parent 355 | c5a7a7273986 |
child 525 | c7f94f6e51f0 |
permissions | -rwxr-xr-x |
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 |
;; |
457
2fd528c49173
Add MUC message type in sample eventcmd script
Mikael Berthe <mikael@lilotux.net>
parents:
355
diff
changeset
|
25 |
MUC) |
2fd528c49173
Add MUC message type in sample eventcmd script
Mikael Berthe <mikael@lilotux.net>
parents:
355
diff
changeset
|
26 |
# Groupchat message in room $arg2 |
2fd528c49173
Add MUC message type in sample eventcmd script
Mikael Berthe <mikael@lilotux.net>
parents:
355
diff
changeset
|
27 |
;; |
316
e315566f09b0
Add a sample script for the events command
Mikael Berthe <mikael@lilotux.net>
parents:
diff
changeset
|
28 |
OUT) |
e315566f09b0
Add a sample script for the events command
Mikael Berthe <mikael@lilotux.net>
parents:
diff
changeset
|
29 |
# Outgoing message for buddy $arg2 |
e315566f09b0
Add a sample script for the events command
Mikael Berthe <mikael@lilotux.net>
parents:
diff
changeset
|
30 |
;; |
e315566f09b0
Add a sample script for the events command
Mikael Berthe <mikael@lilotux.net>
parents:
diff
changeset
|
31 |
esac |
355
c5a7a7273986
Add some external actions
Mikael Berthe <mikael@lilotux.net>
parents:
316
diff
changeset
|
32 |
elif [ $event == "STATUS" ]; then |
c5a7a7273986
Add some external actions
Mikael Berthe <mikael@lilotux.net>
parents:
316
diff
changeset
|
33 |
# 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
|
34 |
echo > /dev/null |
316
e315566f09b0
Add a sample script for the events command
Mikael Berthe <mikael@lilotux.net>
parents:
diff
changeset
|
35 |
fi |
e315566f09b0
Add a sample script for the events command
Mikael Berthe <mikael@lilotux.net>
parents:
diff
changeset
|
36 |