Created
September 2, 2016 00:55
-
-
Save colindean/91c324f2a04d18e1d2933805a7e0abc0 to your computer and use it in GitHub Desktop.
bitbar plugins as of 20160901
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
#!/bin/bash | |
#### | |
# List available updates from Homebrew (OS X) | |
### | |
exit_with_error() { | |
echo "err | color=red"; | |
exit 1; | |
} | |
/usr/local/bin/brew update > /dev/null || exit_with_error; | |
UPDATES=`/usr/local/bin/brew outdated --verbose`; | |
UPDATE_COUNT=`echo "$UPDATES" | grep -v ^$ | wc -l | sed -e 's/^[[:space:]]*//'`; | |
if [ $UPDATE_COUNT -gt 0 ]; then | |
echo "🍺${UPDATE_COUNT}" | |
fi | |
echo "---"; | |
#echo 'Run upgrade | bash="/usr/local/bin/brew upgrade" terminal="true"' | |
echo "$UPDATES"; |
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
#!/bin/bash | |
# Coinbase.com Spot rate | |
# BitBar plugin | |
# | |
# by Mat Ryer | |
# | |
# Shows latest spot rate values (in USD) for Bitcoins in the | |
# Coinbase exchange. | |
echo -n "Ƀ$"; curl -s "https://coinbase.com/api/v1/prices/spot_rate?currency=USD" | egrep -o '"amount":"[0-9]+(\.)?([0-9]{0,2}")?' | sed 's/"amount"://' | sed 's:^.\(.*\).$:\1:' | awk -F. '{print $1}' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment