Created
December 2, 2015 02:15
-
-
Save craigeley/57d48dca08477d80ba94 to your computer and use it in GitHub Desktop.
A script that shows elapsed time of the current `doing` task in TextBar. Change the path to your doing in line 5.
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
if [[ `/usr/local/bin/doing last` == *"@done"* ]]; then | |
echo "💬"; | |
else | |
name=`/usr/local/bin/doing last | sed 's/@.*//g'`; | |
start=`grep -o -m 1 "\d*-\d*-\d*\s\d*:\d*\s" /path/to/what_was_i_doing.md`; | |
date1=`date -j -f '%Y-%m-%d %H:%M ' "$start" +"%s"`; | |
now=`date -j +"%s"`; | |
diff=$(($now-$date1)); | |
echo "$name 🕗$(printf "%02d" $(($diff / 3600))):$(printf "%02d" $((($diff / 60) % 60)))" | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment