Last active
January 25, 2017 17:58
-
-
Save mroth/1812c71eb1326aa9b92f72870c248155 to your computer and use it in GitHub Desktop.
Adds the currently playing iTunes track to your prepared git commit message.
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
#!/bin/bash | |
# Adds the currently playing iTunes track to your prepared commit message. | |
# | |
# To install, save in repo as chmod +x to .git/hooks/prepare-commit-msg | |
SONG=`osascript -e 'tell application "iTunes" to if player state is playing then "♬ : " & artist of current track & " / " & name of current track'` | |
if [[ $SONG ]]; then | |
echo -e "$(cat $1)\n\n$SONG" > $1 | |
fi |
NOTE: A more robust version of this with Spotify support and an installer now exists at: https://github.com/mroth/git-muzak
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Now updated to work better if you pass your normal commit message with
-m
.Hence

git commit -m "This is my normal short commit message here."
would still look nice when GitHub displays things in history:Idea from this tweet which nerd sniped me: https://twitter.com/sdboyer/status/821097132983730178