event.sh file for mcabber to send notifications via notify-send when recieving messages or updates from users.
This file contains 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
#!/bin/sh | |
#set the following in your .mcabberrc file for notifications | |
#set events_command = ~/.mcabber/event.sh | |
#set events_ignore_active_window = 0 | |
#set event_log_files = 1 | |
#set event_log_dir = /tmp | |
if [ $1 = "MSG" ]; then | |
case "$2" in | |
IN) | |
if [ -n "$4" -a -f "$4" ]; then | |
message="$(cat $4)" | |
notify-send "$3 :: $message" | |
rm $4 | |
fi | |
;; | |
MUC) | |
if [ -n "$4" -a -f "$4" ]; then | |
message="$(cat $4)" | |
notify-send "$3 :: $message" | |
rm $4 | |
fi | |
;; | |
OUT) | |
echo > /dev/null | |
;; | |
esac | |
elif [ $1 = "STATUS" ]; then | |
case "$2" in | |
_) | |
notify-send "$3 has signed off" | |
;; | |
O) | |
notify-send "$3 is now online" | |
;; | |
F) | |
notify-send "$3 is chatty" | |
;; | |
A) | |
notify-send "$3 is away" | |
;; | |
N) | |
notify-send "$3 is now extended away" | |
;; | |
D) | |
notify-send "$3 is busy" | |
;; | |
I) | |
notify-send "$3 is invisible" | |
;; | |
?) | |
notify-send "Something is wrong" | |
;; | |
X) | |
notify-send "$3 has a request" | |
;; | |
esac | |
elif [ $1 = "UNREAD" ]; then | |
notify-send "There are $2 new messages" | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment