Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

storage plugins documentation lists non-existing mpc commands. #289

carnager opened this issue Jun 6, 2018 · 2 comments

storage plugins documentation lists non-existing mpc commands. #289

carnager opened this issue Jun 6, 2018 · 2 comments


Copy link

@carnager carnager commented Jun 6, 2018

has the section about storage mounts, which reads:

 MPD has various storage plugins of which multiple instances can be "mounted" into the music directory. This way, you can use local music, file servers and USB sticks at the same time. Example:

mpc mount foo nfs://
mpc mount usbstick udisks://by-uuid-2F2B-D136
mpc unmount usbstick

MPD's neighbor plugins can be helpful with finding mountable storages:

mpc listneighbors

Neither mount nor listneighbors exists in mpc.

Version used: mpc version: 0.31 (built from git master yesterday)

Copy link

@MaxKellermann MaxKellermann commented Jun 6, 2018

I know I've documented commands that do not exist just yet. Please write feature request for mpc to keep track of this.

Copy link

@ronalde ronalde commented Nov 12, 2018

@carnager You can always use something like this:

#!/usr/bin/env bash
function query_mpd() {
    ## query mpd using bash sockets (so we don't need mpc)
    # open a input/output socket to the mpd host
    exec 3<>/dev/tcp/${mpd_host}/${mpd_port}
    # send a command list to the socket
    printf "command_list_begin\n%s\nclose\ncommand_list_end\n" \
	   "${mpd_command}" >&3
    # read out the result
    while read -r line; do
	echo "${line}"
    # close the sockets
    exec 3<&-
    exec 3>&-

query_mpd "$1" &

When you store this bash script in the file ~/query-mpd you can use the following command to send an arbitrary command to mpd:

bash ~/query-mpd listneighbors

Because the bash script uses printf you can multiple commands by separating them with a newline character (\n) for example:

bash ~/query-mpd "listneighbors\nsomethingelse"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
None yet

No branches or pull requests

3 participants