Skip to content

Instantly share code, notes, and snippets.

@arpanpal010
Created November 25, 2015 12:22
Show Gist options
  • Save arpanpal010/e95f7a67452bbdc96936 to your computer and use it in GitHub Desktop.
Save arpanpal010/e95f7a67452bbdc96936 to your computer and use it in GitHub Desktop.
Skype notification handler, executes libnotify commands on skype events using notify-send
#!/bin/sh
# all variables found so far
# execute the below line for all events
# ~/bin/libnotify-skype.sh "%type" "%sname" "%sskype" "%smessage" "%fpath" "%fname" "%fsize" "%fprogress" "%fspeed"
# below line prints all the param values on any event
# notify-send "$1 $2 $3 $4 $5 $6 $7 $8 $9";
# shorthand for notification
notif () {
local prio, dtime;
[[ -z "$3" ]] && prio="normal" || prio="$3";
[[ -z "$4" ]] && dtime="1000" || dtime="$4";
notify-send -u "$prio" -t "$dtime" "$1" "$2";
}
# each of these cases are an event fired when something happens in skype
# remember to hide default events otherwise it'll show both skype notifications
# as well as notify-send ones.
# customize messages as needed.
case "$1" in
# "SkypeLogin" ) notif "Skype" "Logged In $2($3)" ;;
# "SkypeLogout" ) notif "Skype" "Logged Out $2($3)" ;;
# "SkypeLoginFailed" ) notif "Skype" "Login Failed $2($3) " ;;
"CallConnecting" ) notif "Skype" "Connecting call $2" ;;
"CallRingingIn" ) notif "Skype" "Ringing $2" "critical";;
"CallRingingOut" ) notif "Skype" "$2 ringing" ;;
"CallAnswered" ) notif "Skype" "Answered $2" ;;
# "CallBusy" ) notif "Skype" "$2 Busy" ;;
"CallFailed" ) notif "Skype" "Failed call: $2" ;;
"CallMissed" ) notif "Skype" "Missed $2" ;;
"CallHold" ) notif "Skype" "On hold $2" ;;
"CallResume" ) notif "Skype" "Resumed $2" ;;
"CallHangup" ) notif "Skype" "Disconnected $2" ;;
"CallRemoteHangup" ) notif "Skype" "$2 disconnected" ;;
# "VoicemailReceived" ) notif "Skype" "Voicemail received from $2" ;;
# "VoicemailSent" ) notif "Skype" "Voicemail sent to $2" ;;
# "ContactOnline" ) notif "Skype" "Online: $2($3)" ;;
# "ContactOffline" ) notif "Skype" "Offline: $2($3)" ;;
"ContactAuthRequest" ) notif "Skype" "$2($3) Added You" "critical";;
"ContactAdded" ) notif "Skype" "Added $2($3)" ;;
"ContactDeleted" ) notif "Skype" "Deleted $2($3)" ;;
"ChatIncomingInitial" ) notif "Skype" "$4" "critical" "5000" ;;
"ChatIncoming" ) notif "Skype" "$4" "" "5000";;
# "ChatOutgoing" ) notif "Skype" ">> $2\n: $4" ;;
"ChatJoined" ) notif "Skype" "$2 joined" ;;
"ChatParted" ) notif "Skype" "$2 left" ;;
"TransferRequest" ) notif "Skype" "$2 ~> $6($7K)\nRequesting Transfer " ;;
"TransferComplete" ) notif "Skype" "$2 <~ $6($7K)\nTransfer Complete" ;;
"TransferFailed" ) notif "Skype" "$2 <~ $6($7K)\nTransfer Failed" "critical" "5000" ;;
# "SMSSent" ) notif "Skype" "SMS Sent to $2" ;;
# "SMSFailed" ) notif "Skype" "Failed to SMS $2" "critical" "5000";;
# "Birthday" ) notif "Skype" "Birthday it is!!" ;;
# "OurBirthday" ) notif "Skype" "Its our birthday, TODAY!" ;;
# "SkypeAccess" ) notif "Skype" "Your Skype Wifi session is due to expire in 5 minutes" ;;
# *) notify-send "$1 $2 $3 $4 $5 $6 $7 $8 $9" ;;
esac
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment