Skip to content

Instantly share code, notes, and snippets.

@fijidah
Last active December 15, 2015 15:48
Show Gist options
  • Save fijidah/0da306dee30bdc9671a3 to your computer and use it in GitHub Desktop.
Save fijidah/0da306dee30bdc9671a3 to your computer and use it in GitHub Desktop.
#!/bin/bash
# Watoson plug-in for BitBar
# Watson: https://github.com/TailorDev/Watson
# BitBar: https://github.com/matryer/bitbar
# Save file as watson.5m.sh in plug-ins directory of BitBar and make it executable
source ~/.virtualenv/misc/bin/activate
WATSON_STATUS=`watson status`
python -c "
import sys
import re
PATTERN = re.compile('Project\s+([a-zA-Z0-9_]+)( \[[a-zA-Z0-9_]+\])*\s+started.*')
m = PATTERN.match(sys.argv[1])
if m:
print 'Project:', m.group(1)
else:
print 'NO PROJECT'
" "$WATSON_STATUS"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment