Show lyrics Of Currently Playing Song In Cmus
(MacOS, Linux)
I enjoy listening to music while I'm working on my computer.
I use the cmus
audio player most of the time. In order to get the lyrics of
the current song, I wrote a small simple Bash script ''lyrics-cmus.sh' to display
it in the terminal window. For example:
-
Winfrieds-iMac:MacOS winfried$ lyrics-cmus.sh
-
artist: Kenny Rogers
title : You Decorated My Life
All my life was a paper once plain, pure and white
Till you moved with your pen changing moods now and then
Till the balance was right
Then you added some music, every note was in place
And anybody could see all the changes in me by the look on my face
And you decorated my life, created a world where dreams are a part
And you decorated my life by painting your love all over my heart
You decorated my life
Like a rhyme with no reason in an unfinished song
There was no harmony life meant nothin' to me, until you came along
And you brought out the colors, what a gentle surprise
Now I'm able to see all the things life can be shining soft in your eyes
And you decorated my life, created a world where dreams are a part
And you decorated my life by painting your love all over my heart
You decorated my life
Winfrieds-iMac:cmus winfried$
-
Winfrieds-iMac:cmus winfried$ echo "alias lyrics-cmus=lyrics-cmus.sh" >> ~/.profile
Prerequisite
cmus status script
cmus provides an example of a status script named 'cmus-artist-title.sh'. cmus executes this script every time the status changes, say when a new track is about to start playing. It adds the new status to the file '~/cmus-status.txt'. To activate this mechanism add on cmus(!) command line:-
:set status_display_program=/path/to/program/cmus-artist-title.sh
-
Winfrieds-iMac:cmus winfried$ echo "set status_display_program=/path/to/program/cmus-artist-title.sh" >> ~/.cmus/rc
Bash script 'lyrics-cmus.sh'
What does the script? Check it out:Winfrieds-iMac:cmus winfried$ lyrics-cmus.sh -h Usage: 'lyrics-cmus' [-v] [<artist> <title>] 'lyrics-cmus' retrieves the lyrics for a song from makeitpersonal.co. If no parameter is given the artist and title of the current cmus song will be used. -v: Additionally declaim artist and title using 'say' of OS X. If <artist> and <title> is provided use this data instead of the cmus data. -- <artist> - the name of the artist -- <title> - the title of the song Winfrieds-iMac:cmus winfried$