dotfiles/git/hooks/post-commit
2013-06-26 10:23:12 -04:00

15 lines
536 B
Bash
Executable file

#!/bin/bash
# Grabs the project, kind of specific to github's format username/project
PROJECT=`git remote -v | head -1 | sed 's/.*git@.*:\(.*\).git.*/\1/'`
# Get artist from Spotify
ARTIST=`osascript -e 'tell application "Spotify" to artist of current track'`
# Get track from Spotify
TRACK=`osascript -e 'tell application "Spotify" to name of current track'`
# Make it so!
curl "http://sndcrd.com/api?key=${SNDCRD_KEY}&project=${PROJECT}&artist=${ARTIST}&track=${TRACK}" > /dev/null 2>&1
imagesnap -q ~/.gitshots/`date +%s`.jpg &