K.Mandla's blog of Linux experiences

Bonus points for cmus-remote

I am a lukewarm cmus fan. Just like I am a lukewarm vim fan. Both programs, if I must be honest, are adequate, but somewhat eccentric.

I overlook those eccentricities because they get the job done, and in some cases because they add a few noteworthy fillips.

For example, cmus is one of the few players I have found that is light enough to run at less than 150Mhz. That alone is why I use it on most of my machines.

But cmus in Arch also comes bundled with cmus-remote — which in lieu of running cmus in a session of screen and joining that session as a second user, allows me to control the player via the command line.

To wit: cmus-remote -u pauses the player, and restarts it after I answer the phone.

Or even better, just cmus-remote followed by

player-pauseplayer-nextstatusvol 20

Any of those commands, typed directly into stdin, is piped into the active cmus session, and controls the player remotely.

Tack that on to an ssh session and you don’t need a multiplexer to reach across the room and turn down the volume.

It’s true that a proper, full-featured screen session across ssh would give me direct control and a few more features, but in a pinch, this’ll do.

Related

Post navigation

6 thoughts on “Bonus points for cmus-remote”

I may have asked this before, but have you looked at MPD? It is pretty lightweight, and is actually designed to be interfaced with over the network. It binds to a port and can be controlled from there using a program like mpc, ncmpc, ncmpcpp, or even telnet.

I’ve been a huge cmus fan since your first mention of it here… I don’t really need a remote-controllable / daemon-based player, and cmus is so wonderfully quick and efficient with pretty much any format, even AAC and streaming radio. Still my favorite player.

thank you so much for this post! i literally have on my todo list “figure out if cmus works with sockets”. i guess i can cross it off now :)

cmus-remote has proven incredibly useful already, as i run a command-line install of arch on a netbook, and spend a large part of my time in vim. with my recent revelation of the :sh command (how did i not know this earlier?!), combined with cmus-remote aliases, it’s simple to control my music running in a detached screen session from (nearly) within vim.

Here’s a script I wrote to toggle the pause/play on cmus and start cmus and begin playing if cmus isn’t running. I have it mapped to a global hotkey so that I have instant access to my music anywhere. Oh and replace gnome-terminal with your favorite terminal (xterm):

#!/bin/sh
# Tests if cmus is running and starts it if it isn't.
# Then it toggles play/pause.
# Oh and this command will break if you rename it to
# something containing "cmus".