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:

/Users/winfried/

    Winfrieds-iMac:MacOS winfried$ lyrics-cmus.sh

It gives this output:

/Users/winfried/

    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$
If you find the suffix .sh annoying (as I do), you can add an alias to your ~/.profile file:

/Users/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:

/Users/winfried/

    :set status_display_program=/path/to/program/cmus-artist-title.sh

To make this permanent, add the line above to your ~/.cmus/rc file, i.e.:

/Users/winfried/

    Winfrieds-iMac:cmus winfried$ echo "set status_display_program=/path/to/program/cmus-artist-title.sh" >> ~/.cmus/rc

You can take a look at the script here and download it here. Make sure you check the authenticity of the downloaded file with gpg using the files signature cmus-artist-title.sh.asc.

Bash script 'lyrics-cmus.sh'

What does the script? Check it out:

/Users/winfried/

    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$
    	     
You can take a look at the script here and download it here. Make sure you check the authenticity of the downloaded file with gpg using the files signature lyrics-cmus.sh.asc.