Last active
January 2, 2016 20:29
-
-
Save paulbdavis/8356819 to your computer and use it in GitHub Desktop.
mcabber eventcmd script
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
EVENT_TYPE="$1" | |
EVENT_SUBTYPE="$2" | |
JID="$3" | |
FILE="$4" | |
TITLE="XMPP" | |
SOUND_DIR="$HOME/.mcabber/sounds" | |
SOUND_DEVICE="alsa_output.usb-Burr-Brown_from_TI_USB_Audio_CODEC-00-CODEC.analog-stereo" | |
TIMEOUT=10000 | |
function new_message_in() { | |
paplay -d "$SOUND_DEVICE" "$SOUND_DIR"/receive.wav | |
notify-send -t "$TIMEOUT" "$TITLE" "New message from ${JID}." | |
} | |
function new_message_out() { | |
paplay -d "$SOUND_DEVICE" "$SOUND_DIR"/send.wav | |
} | |
if [[ "$EVENT_TYPE" = "MSG" ]] && [[ "$EVENT_SUBTYPE" = "IN" ]] | |
then | |
new_message_in | |
fi | |
if [[ "$EVENT_TYPE" = "MSG" ]] && [[ "$EVENT_SUBTYPE" = "OUT" ]] | |
then | |
new_message_out | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment