Last active
January 8, 2016 19:49
-
-
Save dschep/8fbb5b1dcc5b4726e566 to your computer and use it in GitHub Desktop.
Stupid simple GitHub desktop notifications! Requires cURL, jq, and notify-send.
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/bash | |
USER='Your username, Duh.' | |
TOKEN='An access token that has access to notifications, make one here: https://github.com/settings/tokens' | |
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" | |
API_URL=https://api.github.com | |
date= | |
while sleep 30; do | |
curl -u $USER:$TOKEN $API_URL/notifications?since=$date |\ | |
jq -r 'map("\(.subject.title) \(.repository.full_name)") | .[]' |\ | |
xargs -n1 -d '\n' notify-send -i $DIR/octocat.png | |
date=$(date +%FT%T) | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment