Adding lyrics to your music in an MPD (Music Player Daemon) + ncmpcpp setup involves a few steps. Here’s a general approach to achieve this:
Step 1: Obtain Lyrics
You need to obtain the lyrics for your music files. There are several ways to do this:
-
Manual Download:
- Search for the lyrics online and save them in a text file.
-
Automated Tools:
Step 2: Embed Lyrics in Music Files
You can embed lyrics into the metadata of your music files (usually supported in formats like MP3 via ID3 tags or in FLAC via Vorbis comments).
-
Using easytag:
-
Using eyeD3 for MP3 files:
-
Using metaflac for FLAC files:
Step 3: Script to Automate the Process
You can write a script to automate fetching and embedding lyrics for all your music files.
Example Bash Script for MP3 files using get-lyrics and eyeD3:
#!/bin/bash
# Navigate to your music directory
cd /path/to/your/music
for file in *.mp3; do
# Extract artist and title from the file (you may need to install `id3v2`)
artist=$(id3v2 -l "$file" | grep "TPE1" | cut -d ':' -f2-)
title=$(id3v2 -l "$file" | grep "TIT2" | cut -d ':' -f2-)
# Fetch lyrics (you may need to install `get-lyrics`)
get-lyrics -a "$artist" -t "$title" -o lyrics.txt
# Embed lyrics into the MP3 file using `eyeD3`
eyeD3 --lyrics-file lyrics.txt "$file"
# Clean up
rm lyrics.txt
done
Step 4: Update MPD Database
After embedding lyrics, you need to update your MPD database:
mpc update
Step 5: View Lyrics in ncmpcpp
ncmpcpp should now be able to display lyrics if they are embedded in the music files. You can usually view lyrics by pressing F10 while a song is playing.
Notes
- Ensure your music files support embedding lyrics in their metadata.
- The accuracy of automated lyric fetching tools may vary.
- Some music players and tag editors may have different methods or support for displaying lyrics.
By following these steps, you should be able to add and view lyrics for all your music in your MPD + ncmpcpp setup.