Last active
May 8, 2019 16:17
-
-
Save Stoffo/f70117f54e32430e5018896cdd82dfdb to your computer and use it in GitHub Desktop.
Checks The GitHub API for Pull Requests to Review and changes the color of Anybar
This file contains hidden or 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
#!/usr/bin/env bash | |
GITHUB_USERNAME= | |
GITHUB_AUTH_TOKEN= | |
GITHUB_SEARCH_QUERY="is:open%20is:pr%20review-requested:Stoffo%20archived:false" | |
change_anybar_color () { | |
echo -n $1 | nc -4u -w0 localhost 1738 | |
} | |
change_anybar_color "question" | |
PULL_REQUEST_COUNT=$(curl -s -u ${GITHUB_USERNAME}:${GITHUB_AUTH_TOKEN} 'https://api.github.com/search/issues?q=${GITHUB_SEARCH_QUERY}' | jq .total_count) | |
echo ${PULL_REQUEST_COUNT} | |
if [ "${PULL_REQUEST_COUNT}" -gt 0 ]; then | |
change_anybar_color "exclamation" | |
else | |
change_anybar_color "green" | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
https://github.com/tonsky/AnyBar