Skip to content

Instantly share code, notes, and snippets.

@JamesTheBard
Created June 10, 2013 06:21
Show Gist options
  • Star 9 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save JamesTheBard/5746867 to your computer and use it in GitHub Desktop.
Save JamesTheBard/5746867 to your computer and use it in GitHub Desktop.
mcabber notification script
#!/bin/sh
echo "$1 $2 $3 $4" >> ~/test.mcabber.log
EVENT_TYPE=$1
EVENT_SUBTYPE=$2
JID=$3
FILE=$4
TITLE="Google Hangouts"
SOUND_FILE="$HOME/.mcabber/sounds/alert_47.wav"
ICON="$HOME/.mcabber/images/chat.png"
TIMEOUT=10000
function new_message_in() {
notify-send -i $ICON -t $TIMEOUT "$TITLE" "New message from ${JID}."
aplay -d 2 $SOUND_FILE
}
if [ $EVENT_TYPE == "MSG" ] && [ $EVENT_SUBTYPE == "IN" ]
then
new_message_in
fi
@tobytes
Copy link

tobytes commented Dec 19, 2013

Very nice script. Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment