cmus-lyrics is a bash script that fetches lyrics of current song playing in [CMus] (C* Music Player) or directly typed by user. To perform the former, the Cmus Now Playing script1 is used.
cmus
- is a small ncurses based music player. It supports various output methods by output-plugins. cmus has completely configurable keybindings and can be controlled from the outside via cmus-remotecurl
- is a tool to transfer data from or to a server, using one of the supported protocols (DICT, FILE, FTP, FTPS, GOPHER, HTTP, HTTPS, IMAP, IMAPS, LDAP, LDAPS, POP3, POP3S, RTMP, RTSP, SCP, SFTP, SMB, SMBS, SMTP, SMTPS, TELNET and TFTP). The command is designed to work without user interaction.jq
- is a lightweight and flexible command-line JSON processor.w3m
- is a pager/text-based WWW browser. You can browse local documents and/or documents on the WWW using a terminal emulator.tr
- is an UNIX utility for translating, or deleting, or squeezing repeated characters.awk
- is a powerful method for processing or analysing text files—in particular, data files that are organised by lines (rows) and columns.
LyricsGet.sh SONG ARTIST ALBUM
It fetches information from azlyrics.com, but retrieving and parsing information from the webpage. Therefore, the data is parse with w3m
and regular expressions.
LyricsGet_musix.sh SONG ARTIST ALBUM
It fetches information from musixmatch.com, and requires an API key.
The information is obtained in json format, for which jq
is used.
CmusNow.sh
In any folder, download cmus-lyrics
by cloning the project
git clone https://github.com/guxsousa/cmus-lyrics.git
or by getting a zip
wget https://github.com/guxsousa/cmus-lyrics/archive/master.zip
unzip cmus-lyrics-master.zip
Get inside the folder and check permissions to make the files executable
cd cmus-lyrics-master/
chmod 755 *.sh
cd ..
In some OSs, the relative path to LyricsGet.sh
inside CmusNowLyrics.sh
works well, in some others it requires further processing or an absolute path. Edit this field accordingly.
~ line 41
Run ./CmusNowLyrics.sh
and it will print information of the song currently playing in CMus
./CmusNowLyrics.sh
Run ./LyricsGet.sh
and it will use the values to fetch lyrics of the song
./LyricsGet.sh 'artist' 'title' 'album'
Likewise ./LyricsGet_musix.sh
, yet restricted to 30% of the text if using a basic account. Please mind the API
field.
./LyricsGet_musix.sh 'artist' 'title' 'album'
This software is licensed under the GNU General Public License.
Gus Sousa -- guxsousa