Skip to content

Instantly share code, notes, and snippets.

@lithid
Created January 23, 2012 02:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lithid/1660186 to your computer and use it in GitHub Desktop.
Save lithid/1660186 to your computer and use it in GitHub Desktop.
Audible notification of new google voice text
#!/bin/bash
# Lithid
while true; do
# Title of the google voice window to look for
# Gmail
#MESSAGE=$(xwininfo -tree -root |grep -c "Gmail - Inbox ([1-999])")
# Google Voice
MESSAGE=$(xwininfo -tree -root |grep -c "Google Voice - Inbox ([1-999])")
# File to play audible notification
SOUND="/usr/share/sounds/purple/receive.wav"
# How many seconds between reminders. 0 means none
NUM="15"
if [ "$MESSAGE" -eq "1" ]; then
aplay $SOUND 2> /dev/null
sleep $NUM
fi
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment