Command Line Music With CMUS
With my recent focus on minimalism and efficiency in my work environment, it seemed like a good time to take a look at the state of command line music players. I’m glad I did, because the C* Music Player, also known as “cmus”, is fantastic. It’s small, scriptable, and has a great feature set; perfect for the hacker looking for some background music.
CMUS is an Ncurses based application. I’ve had mixed feelings about ncurses based on previous experience with SUSE Linux and the YaST interface. Many times I found YaST to be clunky and slow, but the cmus implementation is very nice. The included man page has a very nice step by step walkthrough that should get your setup and running fairly quickly. Once you’ve added music to your library you can then go back to your overview by hitting the number one, and then using the arrow keys in the to navigate through your folder hierarchy choosing individual songs or a top-level folder to play all the songs in the folder, and pressing enter to play.
Since playing music in the background is not what my workstation is dedicated to, I wanted to make sure that whatever application I chose used very little resources. In my tests cmus used around 8MB of memory and between one and two percent CPU. At the very least I could say that the scene music player uses so few resources that I doubt that I will ever notice the impact.
Cmus also makes it easy to create a playlist, and then save that playlist to a file. I only ever really listen to one playlist while I’m working, something I call my concentrate playlist. The C* Music Player uses several vi commands, which is another reason why this particular music player appeals to me so much. It seems clear to me that the developer of this application was using vi, and probably wanted to switch between vi and cmus without needing to remap his brain for different shortcut keys.
A couple of things that I found interesting while using cmus that are different than using more traditional GUI music players. For one, there is no option to control the volume of the music being played. That means that there is only a single volume for all sound, the main system volume for the computer. That makes sense to me. I was always a little bit confused about how I should configure my volume when there is both a volume for the music player and for the computer. I was always searching for that perfect mix between the two. Secondly, once you close the window that cmus is running in the music stops and cmus is gone. Where before I might launch rhythmbox and let it run in the background after I close the window, for cmus I actually still need to keep the shell running. Luckily, since it is just a command line application, the obvious way around that is to launch cmus in screen. That way, while screen is running you can detach from the shell and close the terminal window, and the screen will keep cmus running in the background as expected.
As noted above cmus is extendible, and I think it’s only a matter of time before I figure out a way to pipe the currently playing artists and song name into the xmobar of my xmonad setup. Cmus is well documented, actively updated, and easy to use. It is hard to find too many faults in the application. Admittedly, I may be viewing it through rose-colored glasses because I’m not really a power user when it comes to music players. For my needs it’s enough to take a list of songs and then cycle through the songs, and if it takes a few days to cycle through them that’s fine. As long as I’ve got my collection of live Grateful Dead albums playing in the background while I work that’s all that I need, cmus fits the bill.