automatically fetch lyrics with mpd
I have a decently sized music collection and I use mpd and pimpd2 to enjoy it. I rarely use ncmpcpp myself, but I’ve found a very good use for it.
Autostart it when you start your screen session and forget about it:
.screenrc:
screen -t nc ncmpcpp
$XDG_CONFIG_HOME/ncmpcpp/config:
lyrics_directory = ~/dev/lyrics/
follow_now_playing_lyrics = yes
store_lyrics_in_song_dir = no
fetch_lyrics_for_current_song_in_background = yes
Now, whenever a song change occurs in mpd, the lyrics is automatically fetched in the background.
Now we want a way to store the ever-expanding collection of lyrics and always keep it up to date. It’s all textual data so obviously we use git.
lyrics_update:
#!/bin/sh
cd $HOME/dev/lyrics &&
git add . &&
git commit -m 'update lyrics' && git push
and we stuff that in a crontab:
0 * * * * sh /home/scp1/dev/utils/lyrics_update
The update script will run once every hour.
As of this writing, I’ve collected a total of 510654 lines of lyrics and they can be digested here.