mcabber/contrib/eventcmd
author Mikael Berthe <mikael@lilotux.net>
Fri, 15 Jul 2005 13:52:45 +0100
changeset 316 e315566f09b0
child 355 c5a7a7273986
permissions -rwxr-xr-x
Add a sample script for the events command
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
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
e315566f09b0 Add a sample script for the events command
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    29
fi
e315566f09b0 Add a sample script for the events command
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    30