Skip to content

Feature Request: API to list mpris players #47

@ilgarmehmetali

Description

@ilgarmehmetali

While using the library, a function to find players instead of dealing with dbus would be nice.

Some research data from me:

According to MPRIS D-Bus Interface Specification;
Each media player must request a unique bus name which begins with org.mpris.MediaPlayer2.

And this project just pulled all the names and grepped the ones starting with org.mpris.MediaPlayer2;

function list-valid-player-targets {
    echo "$(dbus-send --session --dest=org.freedesktop.DBus \
        --type=method_call --print-reply /org/freedesktop/DBus \
        org.freedesktop.DBus.ListNames | grep org.mpris.MediaPlayer2 |
        awk -F\" '{print $2}' | cut -d '.' -f4- | sort )"
}

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions