-
-
Save jbcpollak/1754491 to your computer and use it in GitHub Desktop.
Patched file for 1.3.2 Growl with android-notifier
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 | |
# ANDROID_NOTIFICATION is in the format DEVICE_ID/NOTIFICATION_ID/EVENT_TYPE/EVENT_CONTENTS | |
NOTIFICATION_TYPE="`echo $ANDROID_NOTIFICATION | sed 's/.*\/.*\/\(.*\)\/.*/\1/'`" | |
NOTIFICATION_DATA="`echo $ANDROID_NOTIFICATION | sed 's/.*\///'`" | |
if [ "x$NOTIFICATION_TYPE" == "xRING" ]; then | |
TEXT_TO_SAY="Call from" | |
elif [ "x$NOTIFICATION_TYPE" == "xSMS" ]; then | |
TEXT_TO_SAY="SMS received:" | |
elif [ "x$NOTIFICATION_TYPE" == "xMMS" ]; then | |
TEXT_TO_SAY="MMS received:" | |
elif [ "x$NOTIFICATION_TYPE" == "xBATTERY" ]; then | |
TEXT_TO_SAY="Battery status:" | |
else | |
TEXT_TO_SAY="Unknown notification received" | |
#exit | |
fi | |
TEXT_TO_SAY="$TEXT_TO_SAY $NOTIFICATION_DATA" | |
/usr/local/bin/growlnotify -m "$TEXT_TO_SAY" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hardened the script with quotes in case the input data was garbage.