Command to output settings of current controls

I am an avid user of bumblebee-status as my i3bar. It has a nifty module for cmus that allows for displaying and interacting with cmus from the bar. However, I prefer to use moc over cmus because it can easily run in the background thanks to the server implementation and the commands for controlling it are shorter and I think a bit more sensible. So I attempted to make a bumblebee-status module for moc but I ran into a bit of a problem.

In cmus the cmus-remote -Q command outputs the status of its settings along with the information about the currently playing audio file. This allows the module and the program to stay synced up as far as the icons and such for repeat and shuffle settings.

However, moc has no such command. The closest we get is moc -i, which outputs plenty of information about the song that is playing, but says nothing about the repeat and shuffle settings. I can use the module to change moc's settings just fine, but if I change the settings from within mocp or the command line the module gets out of sync, as there is no way for it to check moc's settings and update itself accordingly. I could code it so that it forces moc's settings to stay in sync with it, but this is very clunky and might be confusing, and ideally moc is the one with the last word, rather than a module.

If anyone knows of a way to check the current settings please let me know. Otherwise here's a feature request for you.


Adding shuffle and repeat info to the -i option shouldn't be a problem, the function to get the info about those parameters from the server is there, it's just not called for -i.

However, I'm not sure if -i option is good place to get the info from.

I will get back to you.

Yeah that's totally understandable, the -i option doesn't really advertise that sort of functionality after all. Let me know if there anything I can help you with.

It turns out there is a plan for this functionality already, see this Features request discussion.

I don't know how advanced are the works on this... Maybe, in the meantime, you could apply/adapt patch from this thread to your MOC dev head?